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

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

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.mm
diff --git a/ios/clean/chrome/browser/ui/context_menu/context_menu_item.mm b/ios/clean/chrome/browser/ui/context_menu/context_menu_item.mm
index 7af094159c5970b1fb9637519dabe113c4e27dfe..0a15afae17e5f090b85478dcc493e276091503e3 100644
--- a/ios/clean/chrome/browser/ui/context_menu/context_menu_item.mm
+++ b/ios/clean/chrome/browser/ui/context_menu/context_menu_item.mm
@@ -8,41 +8,40 @@
#error "This file requires ARC support."
#endif
-@interface ContextMenuItem () {
- // Backing object for |commands|.
- std::vector<SEL> _commands;
-}
+@interface ContextMenuItem ()
// Convenience initializer for use by the factory method.
- (instancetype)initWithTitle:(NSString*)title
- commands:(const std::vector<SEL>&)commands;
+ command:(SEL)command
+ commandOpensTab:(BOOL)commandOpensTab NS_DESIGNATED_INITIALIZER;
@end
@implementation ContextMenuItem
@synthesize title = _title;
+@synthesize command = _command;
+@synthesize commandOpensTab = _commandOpensTab;
- (instancetype)initWithTitle:(NSString*)title
- commands:(const std::vector<SEL>&)commands {
+ command:(SEL)command
+ commandOpensTab:(BOOL)commandOpensTab {
if ((self = [super init])) {
_title = [title copy];
- _commands = commands;
+ _command = command;
+ _commandOpensTab = commandOpensTab;
}
return self;
}
-#pragma mark - Accessors
-
-- (const std::vector<SEL>&)commands {
- return _commands;
-}
-
#pragma mark - Public
+ (instancetype)itemWithTitle:(NSString*)title
- commands:(const std::vector<SEL>&)commands {
- return [[ContextMenuItem alloc] initWithTitle:title commands:commands];
+ command:(SEL)command
+ commandOpensTab:(BOOL)commandOpensTab {
+ return [[ContextMenuItem alloc] initWithTitle:title
+ command:command
+ commandOpensTab:commandOpensTab];
}
@end

Powered by Google App Engine
This is Rietveld 408576698