Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5437)

Unified Diff: chrome/browser/ui/cocoa/chrome_event_processing_window.mm

Issue 1250403002: [Mac] Move UI item validation to UserInterfaceItemCommandHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@commandexecute
Patch Set: Sync to new CommandDispatcher design. Add UserInterfaceItemCommandHandler. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 646bcda011fd4cb5b7c108a534dc0127feee28f4..6f27d46893af42b32bbb5be44528ba68c8ea0f48 100644
--- a/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
+++ b/chrome/browser/ui/cocoa/chrome_event_processing_window.mm
@@ -21,6 +21,7 @@
commandDispatcherDelegate_.reset(
[[ChromeCommandDispatcherDelegate alloc] init]);
[commandDispatcher_ setDelegate:commandDispatcherDelegate_];
+ [self setCommandHandler:commandDispatcherDelegate_];
}
return self;
}
@@ -32,6 +33,8 @@
// CommandDispatchingWindow implementation.
+@synthesize commandHandler;
+
- (BOOL)redispatchKeyEvent:(NSEvent*)event {
return [commandDispatcher_ redispatchKeyEvent:event];
}
@@ -40,6 +43,18 @@
return [super performKeyEquivalent:event];
}
+- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
+ return [[self commandHandler] validateUserInterfaceItem:item window:self];
+}
+
+- (void)commandDispatch:(id)sender {
+ [[self commandHandler] commandDispatch:sender window:self];
+}
+
+- (void)commandDispatchUsingKeyModifiers:(id)sender {
+ [[self commandHandler] commandDispatchUsingKeyModifiers:sender window:self];
+}
+
// NSWindow overrides.
- (BOOL)performKeyEquivalent:(NSEvent*)event {

Powered by Google App Engine
This is Rietveld 408576698