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

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: Sync 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 - (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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698