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

Side by Side 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: Address comments. Created 5 years, 3 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698