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 1de283fb956b7dc53d180ed36ec06e1e07d4ae91..9ef65daf887f10f4e9633a8dd4a3e6aa4f7a6d58 100644 |
--- a/ui/views/cocoa/native_widget_mac_nswindow.mm |
+++ b/ui/views/cocoa/native_widget_mac_nswindow.mm |
@@ -23,6 +23,7 @@ |
@implementation NativeWidgetMacNSWindow { |
@private |
base::scoped_nsobject<CommandDispatcher> commandDispatcher_; |
+ id<UserInterfaceItemCommandHandler> commandHandler_; |
} |
- (instancetype)initWithContentRect:(NSRect)contentRect |
@@ -44,6 +45,11 @@ |
[commandDispatcher_ setDelegate:delegate]; |
} |
+- (void)setUserInterfaceItemCommandHandler: |
+ (id<UserInterfaceItemCommandHandler>)commandHandler { |
+ commandHandler_ = commandHandler; |
+} |
+ |
// Private methods. |
- (ViewsNSWindowDelegate*)viewsNSWindowDelegate { |
@@ -168,4 +174,16 @@ |
return [super performKeyEquivalent:event]; |
} |
+- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { |
tapted
2015/09/03 04:15:38
same comments as on CEPW
jackhou1
2015/09/03 06:15:39
Done.
|
+ return [commandHandler_ validateUserInterfaceItem:item window:self]; |
+} |
+ |
+- (void)commandDispatch:(id)sender { |
+ [commandHandler_ commandDispatch:sender window:self]; |
+} |
+ |
+- (void)commandDispatchUsingKeyModifiers:(id)sender { |
+ [commandHandler_ commandDispatchUsingKeyModifiers:sender window:self]; |
+} |
+ |
@end |