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

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

Issue 2889483002: [ios clean] Creates ToolsMenu model. (Closed)
Patch Set: Move TODO comment. Created 3 years, 7 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_CLEAN_CHROME_BROWSER_UI_TOOLS_TOOLS_MENU_MODEL_H_
6 #define IOS_CLEAN_CHROME_BROWSER_UI_TOOLS_TOOLS_MENU_MODEL_H_
7
8 #import <Foundation/Foundation.h>
9
10 // Total number of possible menu items.
11 const int kToolsMenuNumberOfItems = 16;
12
13 // Struct for a single MenuModelItem.
14 struct MenuModelItem {
15 // Item Title ID.
16 int title_id;
17 // Item Accessibility ID.
18 // TODO(crbug.com/682880): Move tools_menu_constants.h file to shared/.
19 NSString* accessibility_id;
20 // The ToolbarType on which the item is visible.
21 int toolbar_types;
22 // |visibility| is applied if a menu item is included for a given
23 // |toolbar_types|. A value of 0 means the menu item is always visible for
24 // the given |toolbar_types|.
25 int visibility;
26 // The selector name which will be called on the dispatcher, when the
27 // item is selected.
28 NSString* selector;
29 };
30
31 // Menu items can be marked as visible or not when Incognito is enabled.
32 // The following bits are used for |visibility| field in |MenuModelItem|.
33 typedef NS_OPTIONS(NSUInteger, ItemVisible) {
34 // clang-format off
35 ItemVisibleAlways = 0,
36 ItemVisibleIncognitoOnly = 1 << 0,
37 ItemVisibleNotIncognitoOnly = 1 << 1,
38 // clang-format on
39 };
40
41 // Flags for different toolbar types.
42 typedef NS_OPTIONS(NSUInteger, ToolbarType) {
43 // clang-format off
44 ToolbarTypeNone = 0,
45 ToolbarTypeWeb = 1 << 0,
46 ToolbarTypeSwitcher = 1 << 1,
47 ToolbarTypeAll = ToolbarTypeWeb | ToolbarTypeSwitcher,
48 // clang-format on
49 };
50
51 // All possible items.
52 extern const MenuModelItem itemsModelList[kToolsMenuNumberOfItems];
53
54 #endif // IOS_CLEAN_CHROME_BROWSER_UI_TOOLS_TOOLS_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/tools/tools_mediator_unittest.mm ('k') | ios/clean/chrome/browser/ui/tools/tools_menu_model.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698