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

Unified Diff: ui/views/cocoa/native_widget_mac_nswindow.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
« no previous file with comments | « ui/base/cocoa/command_dispatcher.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/native_widget_mac_nswindow.mm
diff --git a/ui/views/cocoa/native_widget_mac_nswindow.mm b/ui/views/cocoa/native_widget_mac_nswindow.mm
index 0f077fe12b65c90ba4126e6ba6496e134b0071f7..134c914f4da00a93943e73359aa9a36d5031ff84 100644
--- a/ui/views/cocoa/native_widget_mac_nswindow.mm
+++ b/ui/views/cocoa/native_widget_mac_nswindow.mm
@@ -198,32 +198,25 @@
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 (NSUserInterfaceItemValidations 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];
-
- id appController = [NSApp delegate];
- DCHECK([appController
- conformsToProtocol:@protocol(NSUserInterfaceValidations)]);
- return [appController validateUserInterfaceItem:item];
- }
-
- return [super validateUserInterfaceItem:item];
+ return [commandDispatcher_ validateUserInterfaceItem:item
+ forHandler:commandHandler_];
}
@end
« no previous file with comments | « ui/base/cocoa/command_dispatcher.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698