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

Unified Diff: ui/base/ios/cru_context_menu_controller.mm

Issue 1144873002: Add a callback for cancelling the context menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ios/cru_context_menu_controller.mm
diff --git a/ui/base/ios/cru_context_menu_controller.mm b/ui/base/ios/cru_context_menu_controller.mm
index c81615c0d644fcd8af83e2e73247ea1d20d6789d..27ce9ee25808a5151507b0c5b16bc81cc109bc3a 100644
--- a/ui/base/ios/cru_context_menu_controller.mm
+++ b/ui/base/ios/cru_context_menu_controller.mm
@@ -268,10 +268,13 @@ CGFloat GetScreenHeight() {
}];
// Cancel button goes last, to match other browsers.
+ void (^cancelHandler)(UIAlertAction*) = ^(UIAlertAction* action) {
+ [weakSelf setVisible:NO];
+ };
UIAlertAction* cancel_action =
[UIAlertAction actionWithTitle:l10n_util::GetNSString(IDS_APP_CANCEL)
style:UIAlertActionStyleCancel
- handler:nil];
+ handler:cancelHandler];
[alert addAction:cancel_action];
// Present sheet/popover using controller that is added to view hierarchy.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698