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

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

Issue 2862783002: [iOS Clean] Wired up ContextMenuCommands. (Closed)
Patch Set: 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_view_controller.mm
diff --git a/ios/clean/chrome/browser/ui/context_menu/context_menu_view_controller.mm b/ios/clean/chrome/browser/ui/context_menu/context_menu_view_controller.mm
index 4178094ccbf8eccadbcfa3b405c446ce6e7a5c3b..8de910738878202a089a750b5804ec42b346383a 100644
--- a/ios/clean/chrome/browser/ui/context_menu/context_menu_view_controller.mm
+++ b/ios/clean/chrome/browser/ui/context_menu/context_menu_view_controller.mm
@@ -4,6 +4,8 @@
#import "ios/clean/chrome/browser/ui/context_menu/context_menu_view_controller.h"
+#import "ios/clean/chrome/browser/ui/commands/context_menu_commands.h"
+
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@@ -21,7 +23,7 @@ @interface ContextMenuViewController ()
@implementation ContextMenuViewController
@synthesize dispatcher = _dispatcher;
-- (instancetype)initWithDispatcher:(id)dispatcher {
+- (instancetype)initWithDispatcher:(id<ContextMenuCommands>)dispatcher {
self =
[[self class] alertControllerWithTitle:nil
message:nil
@@ -51,9 +53,12 @@ - (void)setContextMenuItems:(NSArray<ContextMenuItem*>*)items {
}
// Always add a cancel action.
+ AlertActionHandler cancelHandler = ^(UIAlertAction* action) {
+ [self.dispatcher cancelContextMenu];
+ };
[self addAction:[UIAlertAction actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel
- handler:nil]];
+ handler:cancelHandler]];
}
@end

Powered by Google App Engine
This is Rietveld 408576698