| OLD | NEW |
| (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_ |
| OLD | NEW |