Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: ios/clean/chrome/browser/ui/tools/tools_menu_model.h

Issue 2889483002: [ios clean] Creates ToolsMenu model. (Closed)
Patch Set: Move TODO comment. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..23ebf056fb1672c75538d5d2ca7a0e4d9bbf6379
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/tools/tools_menu_model.h
@@ -0,0 +1,54 @@
+// 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;
+
+// Struct for a single MenuModelItem.
+struct MenuModelItem {
+ // Item Title ID.
+ int title_id;
+ // Item Accessibility ID.
+ // TODO(crbug.com/682880): Move tools_menu_constants.h file to shared/.
+ 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 |MenuModelItem|.
+typedef NS_OPTIONS(NSUInteger, ItemVisible) {
+ // clang-format off
+ ItemVisibleAlways = 0,
+ ItemVisibleIncognitoOnly = 1 << 0,
+ ItemVisibleNotIncognitoOnly = 1 << 1,
+ // clang-format on
+};
+
+// 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_
« no previous file with comments | « ios/clean/chrome/browser/ui/tools/tools_mediator_unittest.mm ('k') | ios/clean/chrome/browser/ui/tools/tools_menu_model.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698