Index: ios/clean/chrome/browser/ui/context_menu/context_menu_consumer.h |
diff --git a/ios/clean/chrome/browser/ui/context_menu/context_menu_consumer.h b/ios/clean/chrome/browser/ui/context_menu/context_menu_consumer.h |
index f54c7df137fe1ae1597d707872bf8dc7b5e70ec2..97305dbeca2e11f13fbc1ed1e30226477de92c7a 100644 |
--- a/ios/clean/chrome/browser/ui/context_menu/context_menu_consumer.h |
+++ b/ios/clean/chrome/browser/ui/context_menu/context_menu_consumer.h |
@@ -5,37 +5,28 @@ |
#ifndef IOS_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_CONSUMER_H_ |
#define IOS_CLEAN_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_CONSUMER_H_ |
-#import <Foundation/Foundation.h> |
+#import "ios/clean/chrome/browser/ui/context_menu/context_menu_item.h" |
-// Object encapsulating configuration information for an item in a context menu. |
-@interface ContextMenuItem : NSObject |
- |
-// Create a new item with |title| and |command|. |
-+ (instancetype)itemWithTitle:(NSString*)title command:(NSInvocation*)command; |
- |
-// The title associated with the item. This is usually the text the user will |
-// see. |
-@property(nonatomic, readonly) NSString* title; |
- |
-// The selector and parameters that will be called when the item is |
-// selected. |
-@property(nonatomic, readonly) NSInvocation* command; |
- |
-@end |
+@class ContextMenuContext; |
// A ContextMenuConsumer (typically a view controller) uses data provided by |
// this protocol to display an run a context menu. |
@protocol ContextMenuConsumer |
+// Sets the context that should be sent with the ContextMenuCommands dispatched |
+// by ContextMenuItems added to this consumer. |
+- (void)setContextMenuContext:(ContextMenuContext*)context; |
+ |
// Informs the consumer that the overall title of the context menu will be |
// |title|. This method should be called only once in the lifetime of the |
// consumer. |
- (void)setContextMenuTitle:(NSString*)title; |
// Informs the consumer that the context menu should display the items defined |
-// in |items|. This method should be called only once in the lifetime of the |
-// consumer. |
-- (void)setContextMenuItems:(NSArray<ContextMenuItem*>*)items; |
+// in |items|. |cancelItem| will be added as the last option in the menu. This |
+// method should be called only once in the lifetime of the consumer. |
+- (void)setContextMenuItems:(NSArray<ContextMenuItem*>*)items |
+ cancelItem:(ContextMenuItem*)cancelItem; |
@end |