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

Unified Diff: ios/clean/chrome/browser/ui/context_menu/context_menu_item.h

Issue 2917973002: [iOS Clean] Update ContextMenuItem to use a single command. (Closed)
Patch Set: rebase 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/context_menu/context_menu_item.h
diff --git a/ios/clean/chrome/browser/ui/context_menu/context_menu_item.h b/ios/clean/chrome/browser/ui/context_menu/context_menu_item.h
index deb4d7ff3daf17cb25db0da4839b67b672278a9e..1dae3a8883470e013c7a1866d5dea404c3c4c15f 100644
--- a/ios/clean/chrome/browser/ui/context_menu/context_menu_item.h
+++ b/ios/clean/chrome/browser/ui/context_menu/context_menu_item.h
@@ -11,17 +11,23 @@
// Object encapsulating configuration information for an item in a context menu.
@interface ContextMenuItem : NSObject
+// ContextMenuItems should be created through the factory method.
+- (instancetype)init NS_UNAVAILABLE;
+
// Create a new item with |title| and |commands|.
+ (instancetype)itemWithTitle:(NSString*)title
- commands:(const std::vector<SEL>&)commands;
+ command:(SEL)command
+ commandOpensTab:(BOOL)commandOpensTab;
// The title associated with the item. This is usually the text the user will
// see.
@property(nonatomic, readonly, copy) NSString* title;
-// The ContextMenuCommands to be dispatched with menu's ContextMenuContext.
-// They will be dispatched in the order in which they appear in the vector.
-@property(nonatomic, readonly, assign) const std::vector<SEL>& commands;
+// The ContextMenuCommand to be dispatched with menu's ContextMenuContext.
+@property(nonatomic, readonly, assign) SEL command;
+
+// Returns whether dispatching |command| will open a new tab.
+@property(nonatomic, readonly, assign) BOOL commandOpensTab;
@end
« no previous file with comments | « ios/clean/chrome/browser/ui/context_menu/BUILD.gn ('k') | ios/clean/chrome/browser/ui/context_menu/context_menu_item.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698