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

Unified Diff: chrome/browser/ui/cocoa/chrome_event_processing_window.mm

Issue 2666523002: Allow permission bubbles to participate in key event dispatch as if they were a Browser. (Closed)
Patch Set: comments, fix permission->type missed in a refactor Created 3 years, 11 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: chrome/browser/ui/cocoa/chrome_event_processing_window.mm
diff --git a/chrome/browser/ui/cocoa/chrome_event_processing_window.mm b/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
index 53ed04c4a3a6ecd7f2bc4f2fe87dabc9b23cc505..aff79f232af3abdcd596c565c0c425efb2dbfd55 100644
--- a/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
+++ b/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
@@ -53,12 +53,18 @@
return [super performKeyEquivalent:event];
}
+- (BOOL)defaultValidateUserInterfaceItem:
+ (id<NSValidatedUserInterfaceItem>)item {
+ return [super validateUserInterfaceItem:item];
+}
+
- (void)commandDispatch:(id)sender {
- [commandHandler_ commandDispatch:sender window:self];
+ [commandDispatcher_ dispatch:sender forHandler:commandHandler_];
}
- (void)commandDispatchUsingKeyModifiers:(id)sender {
- [commandHandler_ commandDispatchUsingKeyModifiers:sender window:self];
+ [commandDispatcher_ dispatchUsingKeyModifiers:sender
+ forHandler:commandHandler_];
}
// NSWindow overrides.
@@ -75,20 +81,8 @@
// NSWindow overrides (NSUserInterfaceValidations implementation).
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
- // Since this class implements these selectors, |super| will always say they
- // are enabled. Only use [super] to validate other selectors. If there is no
- // command handler, defer to AppController.
- if ([item action] == @selector(commandDispatch:) ||
- [item action] == @selector(commandDispatchUsingKeyModifiers:)) {
- if (commandHandler_)
- return [commandHandler_ validateUserInterfaceItem:item window:self];
-
- AppController* appController =
- base::mac::ObjCCastStrict<AppController>([NSApp delegate]);
- return [appController validateUserInterfaceItem:item];
- }
-
- return [super validateUserInterfaceItem:item];
+ return [commandDispatcher_ validateUserInterfaceItem:item
+ forHandler:commandHandler_];
}
@end // ChromeEventProcessingWindow

Powered by Google App Engine
This is Rietveld 408576698