Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/tools/tools_menu_model.h |
| diff --git a/ios/clean/chrome/browser/ui/tools/tools_menu_model.h b/ios/clean/chrome/browser/ui/tools/tools_menu_model.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..53653d0e7b8a533627a98c3489012db5a5b8d4ad |
| --- /dev/null |
| +++ b/ios/clean/chrome/browser/ui/tools/tools_menu_model.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_CLEAN_CHROME_BROWSER_UI_TOOLS_TOOLS_MENU_MODEL_H_ |
| +#define IOS_CLEAN_CHROME_BROWSER_UI_TOOLS_TOOLS_MENU_MODEL_H_ |
| + |
| +#import <Foundation/Foundation.h> |
| + |
| +// Total number of possible menu items. |
| +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
|
| + |
| +// Struct for a single MenuModelItem. |
| +struct MenuModelItem { |
| + // Item Title ID. |
| + int title_id; |
| + // Item Accessibility ID. |
| + NSString* accessibility_id; |
| + // The ToolbarType on which the item is visible. |
| + int toolbar_types; |
| + // |visibility| is applied if a menu item is included for a given |
| + // |toolbar_types|. A value of 0 means the menu item is always visible for |
| + // the given |toolbar_types|. |
| + int visibility; |
| + // The selector name which will be called on the dispatcher, when the |
| + // item is selected. |
| + NSString* selector; |
| +}; |
| + |
| +// Menu items can be marked as visible or not when Incognito is enabled. |
| +// The following bits are used for |visibility| field in |MenuItemInfo|. |
| +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
|
| +const NSInteger kVisibleIncognitoOnly = 1 << 0; |
| +const NSInteger kVisibleNotIncognitoOnly = 1 << 1; |
| + |
| +// Flags for different toolbar types. |
| +typedef NS_OPTIONS(NSUInteger, ToolbarType) { |
| + // clang-format off |
| + ToolbarTypeNone = 0, |
| + ToolbarTypeWeb = 1 << 0, |
| + ToolbarTypeSwitcher = 1 << 1, |
| + ToolbarTypeAll = ToolbarTypeWeb | ToolbarTypeSwitcher, |
| + // clang-format on |
| +}; |
| + |
| +// All possible items. |
| +extern const MenuModelItem itemsModelList[kToolsMenuNumberOfItems]; |
| + |
| +#endif // IOS_CLEAN_CHROME_BROWSER_UI_TOOLS_TOOLS_MENU_MODEL_H_ |