| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ | 6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" | 10 #import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" |
| 11 | 11 |
| 12 // Total number of possible menu items. | 12 // Total number of possible menu items. |
| 13 const int kToolsMenuNumberOfItems = 15; | 13 const int kToolsMenuNumberOfItems = 16; |
| 14 | 14 |
| 15 // Initialization table for all possible commands to initialize the | 15 // Initialization table for all possible commands to initialize the |
| 16 // tools menu at run time. Data initialized into this structure is not mutable. | 16 // tools menu at run time. Data initialized into this structure is not mutable. |
| 17 struct MenuItemInfo { | 17 struct MenuItemInfo { |
| 18 int title_id; | 18 int title_id; |
| 19 NSString* accessibility_id; | 19 NSString* accessibility_id; |
| 20 int command_id; | 20 int command_id; |
| 21 int toolbar_types; | 21 int toolbar_types; |
| 22 // |visibility| is applied if a menu item is included for a given | 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 | 23 // |toolbar_types|. A value of 0 means the menu item is always visible for |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 // All possible items. | 45 // All possible items. |
| 46 extern const MenuItemInfo itemInfoList[kToolsMenuNumberOfItems]; | 46 extern const MenuItemInfo itemInfoList[kToolsMenuNumberOfItems]; |
| 47 | 47 |
| 48 // Returns true if a given item should be visible based on the Toolbar type | 48 // Returns true if a given item should be visible based on the Toolbar type |
| 49 // and configuration. | 49 // and configuration. |
| 50 bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item, | 50 bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item, |
| 51 ToolbarType toolbarType, | 51 ToolbarType toolbarType, |
| 52 ToolsMenuConfiguration* configuration); | 52 ToolsMenuConfiguration* configuration); |
| 53 | 53 |
| 54 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ | 54 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ |
| OLD | NEW |