| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 5 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h" | 8 #import "chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h" |
| 9 | 9 |
| 10 @implementation ChromeEventProcessingWindow { | 10 @implementation ChromeEventProcessingWindow { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // CommandDispatchingWindow implementation. | 38 // CommandDispatchingWindow implementation. |
| 39 | 39 |
| 40 - (BOOL)redispatchKeyEvent:(NSEvent*)event { | 40 - (BOOL)redispatchKeyEvent:(NSEvent*)event { |
| 41 return [commandDispatcher_ redispatchKeyEvent:event]; | 41 return [commandDispatcher_ redispatchKeyEvent:event]; |
| 42 } | 42 } |
| 43 | 43 |
| 44 - (BOOL)defaultPerformKeyEquivalent:(NSEvent*)event { | 44 - (BOOL)defaultPerformKeyEquivalent:(NSEvent*)event { |
| 45 return [super performKeyEquivalent:event]; | 45 return [super performKeyEquivalent:event]; |
| 46 } | 46 } |
| 47 | 47 |
| 48 - (void)commandDispatch:(id)sender { |
| 49 [commandDispatcherDelegate_ commandDispatch:sender window:self]; |
| 50 } |
| 51 |
| 52 - (void)commandDispatchUsingKeyModifiers:(id)sender { |
| 53 [commandDispatcherDelegate_ commandDispatchUsingKeyModifiers:sender |
| 54 window:self]; |
| 55 } |
| 56 |
| 48 // NSWindow overrides. | 57 // NSWindow overrides. |
| 49 | 58 |
| 50 - (BOOL)performKeyEquivalent:(NSEvent*)event { | 59 - (BOOL)performKeyEquivalent:(NSEvent*)event { |
| 51 return [commandDispatcher_ performKeyEquivalent:event]; | 60 return [commandDispatcher_ performKeyEquivalent:event]; |
| 52 } | 61 } |
| 53 | 62 |
| 54 - (void)sendEvent:(NSEvent*)event { | 63 - (void)sendEvent:(NSEvent*)event { |
| 55 if (![commandDispatcher_ preSendEvent:event]) | 64 if (![commandDispatcher_ preSendEvent:event]) |
| 56 [super sendEvent:event]; | 65 [super sendEvent:event]; |
| 57 } | 66 } |
| 58 | 67 |
| 68 // NSWindow overrides (NSUserInterfaceValidations implementation). |
| 69 |
| 70 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { |
| 71 return |
| 72 [commandDispatcherDelegate_ validateUserInterfaceItem:item window:self] && |
| 73 [super validateUserInterfaceItem:item]; |
| 74 } |
| 75 |
| 59 @end // ChromeEventProcessingWindow | 76 @end // ChromeEventProcessingWindow |
| OLD | NEW |