| 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 // 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. | 10 // Total number of possible menu items. |
| 42 const int kToolsMenuNumberOfItems = 15; | 11 const int kToolsMenuNumberOfItems = 15; |
| 43 | 12 |
| 44 // Initialization table for all possible commands to initialize the | 13 // Initialization table for all possible commands to initialize the |
| 45 // tools menu at run time. Data initialized into this structure is not mutable. | 14 // tools menu at run time. Data initialized into this structure is not mutable. |
| 46 struct MenuItemInfo { | 15 struct MenuItemInfo { |
| 47 int title_id; | 16 int title_id; |
| 48 NSString* accessibility_id; | 17 NSString* accessibility_id; |
| 49 int command_id; | 18 int command_id; |
| 50 int toolbar_types; | 19 int toolbar_types; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 74 // All possible items. | 43 // All possible items. |
| 75 extern const MenuItemInfo itemInfoList[kToolsMenuNumberOfItems]; | 44 extern const MenuItemInfo itemInfoList[kToolsMenuNumberOfItems]; |
| 76 | 45 |
| 77 // Returns true if a given item should be visible based on the Toolbar type | 46 // Returns true if a given item should be visible based on the Toolbar type |
| 78 // and if incognito mode or not. | 47 // and if incognito mode or not. |
| 79 bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item, | 48 bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item, |
| 80 bool incognito, | 49 bool incognito, |
| 81 ToolbarType toolbarType); | 50 ToolbarType toolbarType); |
| 82 | 51 |
| 83 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ | 52 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_MODEL_H_ |
| OLD | NEW |