Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: ios/chrome/browser/ui/tools_menu/tools_menu_model.h

Issue 2706293008: [ios] Creates ToolsMenuModel Class (Closed)
Patch Set: Format Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_
6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_
7
8 #import <Foundation/Foundation.h>
9
10 // New Tab item accessibility Identifier.
11 extern NSString* const kToolsMenuNewTabId;
12 // New incognito Tab item accessibility Identifier.
13 extern NSString* const kToolsMenuNewIncognitoTabId;
14 // Close all Tabs item accessibility Identifier.
15 extern NSString* const kToolsMenuCloseAllTabsId;
16 // Close all incognito Tabs item accessibility Identifier.
17 extern NSString* const kToolsMenuCloseAllIncognitoTabsId;
18 // Bookmarks item accessibility Identifier.
19 extern NSString* const kToolsMenuBookmarksId;
20 // Reading List item accessibility Identifier.
21 extern NSString* const kToolsMenuReadingListId;
22 // Other Devices item accessibility Identifier.
23 extern NSString* const kToolsMenuOtherDevicesId;
24 // History item accessibility Identifier.
25 extern NSString* const kToolsMenuHistoryId;
26 // Report an issue item accessibility Identifier.
27 extern NSString* const kToolsMenuReportAnIssueId;
28 // Find in Page item accessibility Identifier.
29 extern NSString* const kToolsMenuFindInPageId;
30 // Reader Mode item accessibility Identifier.
31 extern NSString* const kToolsMenuReaderMode;
32 // Request desktop item accessibility Identifier.
33 extern NSString* const kToolsMenuRequestDesktopId;
34 // Settings item accessibility Identifier.
35 extern NSString* const kToolsMenuSettingsId;
36 // Help item accessibility Identifier.
37 extern NSString* const kToolsMenuHelpId;
38 // Suggestions item accessibility Identifier.
39 extern NSString* const kToolsMenuSuggestionsId;
40
41 // Total number of possible menu items.
42 const int kToolsMenuNumberOfItems = 15;
43
44 // Initialization table for all possible commands to initialize the
45 // tools menu at run time. Data initialized into this structure is not mutable.
46 struct MenuItemInfo {
47 int title_id;
48 NSString* accessibility_id;
49 int command_id;
50 int toolbar_types;
51 // |visibility| is applied if a menu item is included for a given
52 // |toolbar_types|. A value of 0 means the menu item is always visible for
53 // the given |toolbar_types|.
54 int visibility;
55 // Custom class, if any, for the menu item, or |nil|.
56 Class item_class;
57 };
58
59 // Flags for different toolbar types
60 typedef NS_OPTIONS(NSUInteger, ToolbarType) {
61 // clang-format off
62 ToolbarTypeNone = 0,
63 ToolbarTypeWebiPhone = 1 << 0,
64 ToolbarTypeWebiPad = 1 << 1,
65 ToolbarTypeNoTabsiPad = 1 << 2,
66 ToolbarTypeSwitcheriPhone = 1 << 3,
67 ToolbarTypeWebAll = ToolbarTypeWebiPhone | ToolbarTypeWebiPad,
68 ToolbarTypeAll = ToolbarTypeWebAll |
69 ToolbarTypeSwitcheriPhone |
70 ToolbarTypeNoTabsiPad,
71 // clang-format on
72 };
73
74 // All possible items.
75 extern const MenuItemInfo itemInfoList[kToolsMenuNumberOfItems];
76
77 // Returns true if a given item should be visible based on the Toolbar type
78 // and if incognito mode or not.
79 bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item,
80 bool incognito,
81 ToolbarType toolbarType);
82
83 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/tools_menu/BUILD.gn ('k') | ios/chrome/browser/ui/tools_menu/tools_menu_model.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698