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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
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_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_ 5 #ifndef IOS_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_
6 #define IOS_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_ 6 #define IOS_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #include <vector> 9 #include <vector>
10 10
11 // Object encapsulating configuration information for an item in a context menu. 11 // Object encapsulating configuration information for an item in a context menu.
12 @interface ContextMenuItem : NSObject 12 @interface ContextMenuItem : NSObject
13 13
14 // ContextMenuItems should be created through the factory method.
15 - (instancetype)init NS_UNAVAILABLE;
16
14 // Create a new item with |title| and |commands|. 17 // Create a new item with |title| and |commands|.
15 + (instancetype)itemWithTitle:(NSString*)title 18 + (instancetype)itemWithTitle:(NSString*)title
16 commands:(const std::vector<SEL>&)commands; 19 command:(SEL)command
20 commandOpensTab:(BOOL)commandOpensTab;
17 21
18 // The title associated with the item. This is usually the text the user will 22 // The title associated with the item. This is usually the text the user will
19 // see. 23 // see.
20 @property(nonatomic, readonly, copy) NSString* title; 24 @property(nonatomic, readonly, copy) NSString* title;
21 25
22 // The ContextMenuCommands to be dispatched with menu's ContextMenuContext. 26 // The ContextMenuCommand to be dispatched with menu's ContextMenuContext.
23 // They will be dispatched in the order in which they appear in the vector. 27 @property(nonatomic, readonly, assign) SEL command;
24 @property(nonatomic, readonly, assign) const std::vector<SEL>& commands; 28
29 // Returns whether dispatching |command| will open a new tab.
30 @property(nonatomic, readonly, assign) BOOL commandOpensTab;
25 31
26 @end 32 @end
27 33
28 #endif // IOS_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_ 34 #endif // IOS_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_ITEM_H_
OLDNEW
« 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