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

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

Issue 2889483002: [ios clean] Creates ToolsMenu model. (Closed)
Patch Set: 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;
lpromero 2017/05/23 09:00:44 Can't this be possibly computed from |itemsModelLi
sczs 2017/05/23 20:28:18 This constant is only used here in the header so w
12
13 // Struct for a single MenuModelItem.
14 struct MenuModelItem {
15 // Item Title ID.
16 int title_id;
17 // Item Accessibility ID.
18 NSString* accessibility_id;
19 // The ToolbarType on which the item is visible.
20 int toolbar_types;
21 // |visibility| is applied if a menu item is included for a given
22 // |toolbar_types|. A value of 0 means the menu item is always visible for
23 // the given |toolbar_types|.
24 int visibility;
25 // The selector name which will be called on the dispatcher, when the
26 // item is selected.
27 NSString* selector;
28 };
29
30 // Menu items can be marked as visible or not when Incognito is enabled.
31 // The following bits are used for |visibility| field in |MenuItemInfo|.
32 const NSInteger kVisibleAlways = 0;
lpromero 2017/05/23 09:00:44 Why isn't this an NS_OPTIONS too?
sczs 2017/05/23 20:28:18 You're right got too stuck on the previous Model a
33 const NSInteger kVisibleIncognitoOnly = 1 << 0;
34 const NSInteger kVisibleNotIncognitoOnly = 1 << 1;
35
36 // Flags for different toolbar types.
37 typedef NS_OPTIONS(NSUInteger, ToolbarType) {
38 // clang-format off
39 ToolbarTypeNone = 0,
40 ToolbarTypeWeb = 1 << 0,
41 ToolbarTypeSwitcher = 1 << 1,
42 ToolbarTypeAll = ToolbarTypeWeb | ToolbarTypeSwitcher,
43 // clang-format on
44 };
45
46 // All possible items.
47 extern const MenuModelItem itemsModelList[kToolsMenuNumberOfItems];
48
49 #endif // IOS_CLEAN_CHROME_BROWSER_UI_TOOLS_TOOLS_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698