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 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { | |
tapted
2015/09/03 04:15:38
move down below NSWindow overrides. Maybe
// NSWi
jackhou1
2015/09/03 06:15:39
Done.
| |
49 return | |
50 [commandDispatcherDelegate_ validateUserInterfaceItem:item window:self]; | |
51 } | |
52 | |
53 - (void)commandDispatch:(id)sender { | |
54 [commandDispatcherDelegate_ commandDispatch:sender window:self]; | |
55 } | |
56 | |
57 - (void)commandDispatchUsingKeyModifiers:(id)sender { | |
58 [commandDispatcherDelegate_ commandDispatchUsingKeyModifiers:sender | |
59 window:self]; | |
60 } | |
61 | |
48 // NSWindow overrides. | 62 // NSWindow overrides. |
49 | 63 |
50 - (BOOL)performKeyEquivalent:(NSEvent*)event { | 64 - (BOOL)performKeyEquivalent:(NSEvent*)event { |
51 return [commandDispatcher_ performKeyEquivalent:event]; | 65 return [commandDispatcher_ performKeyEquivalent:event]; |
52 } | 66 } |
53 | 67 |
54 - (void)sendEvent:(NSEvent*)event { | 68 - (void)sendEvent:(NSEvent*)event { |
55 if (![commandDispatcher_ preSendEvent:event]) | 69 if (![commandDispatcher_ preSendEvent:event]) |
56 [super sendEvent:event]; | 70 [super sendEvent:event]; |
57 } | 71 } |
58 | 72 |
59 @end // ChromeEventProcessingWindow | 73 @end // ChromeEventProcessingWindow |
OLD | NEW |