Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/cocoa/native_widget_mac_nswindow.h" | 5 #import "ui/views/cocoa/native_widget_mac_nswindow.h" |
|
tapted
2015/08/27 07:24:42
the header should change too right...? (to impleme
jackhou1
2015/09/03 01:12:49
Done.
In patch set 3 it wasn't necessary for Nati
| |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #import "ui/views/cocoa/views_nswindow_delegate.h" | 8 #import "ui/views/cocoa/views_nswindow_delegate.h" |
| 9 #include "ui/views/controls/menu/menu_controller.h" | 9 #include "ui/views/controls/menu/menu_controller.h" |
| 10 #include "ui/views/widget/native_widget_mac.h" | 10 #include "ui/views/widget/native_widget_mac.h" |
| 11 #include "ui/views/widget/widget_delegate.h" | 11 #include "ui/views/widget/widget_delegate.h" |
| 12 | 12 |
| 13 @interface NativeWidgetMacNSWindow () | 13 @interface NativeWidgetMacNSWindow () |
| 14 - (ViewsNSWindowDelegate*)viewsNSWindowDelegate; | 14 - (ViewsNSWindowDelegate*)viewsNSWindowDelegate; |
| 15 - (views::Widget*)viewsWidget; | 15 - (views::Widget*)viewsWidget; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 | 150 |
| 151 NSCursor* cursor = [[self viewsNSWindowDelegate] cursor]; | 151 NSCursor* cursor = [[self viewsNSWindowDelegate] cursor]; |
| 152 if (cursor) | 152 if (cursor) |
| 153 [cursor set]; | 153 [cursor set]; |
| 154 else | 154 else |
| 155 [super cursorUpdate:theEvent]; | 155 [super cursorUpdate:theEvent]; |
| 156 } | 156 } |
| 157 | 157 |
| 158 // CommandDispatcher implementation. | 158 // CommandDispatcher implementation. |
| 159 | 159 |
| 160 @synthesize commandHandler; | |
| 161 | |
| 160 - (BOOL)redispatchKeyEvent:(NSEvent*)event { | 162 - (BOOL)redispatchKeyEvent:(NSEvent*)event { |
| 161 return [commandDispatcher_ redispatchKeyEvent:event]; | 163 return [commandDispatcher_ redispatchKeyEvent:event]; |
| 162 } | 164 } |
| 163 | 165 |
| 164 - (BOOL)defaultPerformKeyEquivalent:(NSEvent*)event { | 166 - (BOOL)defaultPerformKeyEquivalent:(NSEvent*)event { |
| 165 return [super performKeyEquivalent:event]; | 167 return [super performKeyEquivalent:event]; |
| 166 } | 168 } |
| 167 | 169 |
| 170 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { | |
| 171 return [[self commandHandler] validateUserInterfaceItem:item window:self]; | |
|
tapted
2015/08/28 05:04:02
(if my other comment doesn't make sense) could the
jackhou1
2015/09/03 01:12:49
It feels unnecessary for these methods to go throu
| |
| 172 } | |
| 173 | |
| 174 - (void)commandDispatch:(id)sender { | |
| 175 [[self commandHandler] commandDispatch:sender window:self]; | |
| 176 } | |
| 177 | |
| 178 - (void)commandDispatchUsingKeyModifiers:(id)sender { | |
| 179 [[self commandHandler] commandDispatchUsingKeyModifiers:sender window:self]; | |
| 180 } | |
| 181 | |
| 168 @end | 182 @end |
| OLD | NEW |