Chromium Code Reviews| 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:) || |
|
tapted
2017/02/01 10:35:01
(this logic now moves into CommandDispatcher -- it
|
| - [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 |