| 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. | 10 #import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" |
| 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 | 11 |
| 41 // Total number of possible menu items. | 12 // Total number of possible menu items. |
| 42 const int kToolsMenuNumberOfItems = 15; | 13 const int kToolsMenuNumberOfItems = 15; |
| 43 | 14 |
| 44 // Initialization table for all possible commands to initialize the | 15 // Initialization table for all possible commands to initialize the |
| 45 // 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. |
| 46 struct MenuItemInfo { | 17 struct MenuItemInfo { |
| 47 int title_id; | 18 int title_id; |
| 48 NSString* accessibility_id; | 19 NSString* accessibility_id; |
| 49 int command_id; | 20 int command_id; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 68 ToolbarTypeAll = ToolbarTypeWebAll | | 39 ToolbarTypeAll = ToolbarTypeWebAll | |
| 69 ToolbarTypeSwitcheriPhone | | 40 ToolbarTypeSwitcheriPhone | |
| 70 ToolbarTypeNoTabsiPad, | 41 ToolbarTypeNoTabsiPad, |
| 71 // clang-format on | 42 // clang-format on |
| 72 }; | 43 }; |
| 73 | 44 |
| 74 // All possible items. | 45 // All possible items. |
| 75 extern const MenuItemInfo itemInfoList[kToolsMenuNumberOfItems]; | 46 extern const MenuItemInfo itemInfoList[kToolsMenuNumberOfItems]; |
| 76 | 47 |
| 77 // 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 |
| 78 // and if incognito mode or not. | 49 // and configuration. |
| 79 bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item, | 50 bool ToolsMenuItemShouldBeVisible(const MenuItemInfo& item, |
| 80 bool incognito, | 51 ToolbarType toolbarType, |
| 81 ToolbarType toolbarType); | 52 ToolsMenuConfiguration* configuration); |
| 82 | 53 |
| 83 #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 |