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

Side by Side Diff: ui/base/cocoa/user_interface_item_command_handler.h

Issue 1250403002: [Mac] Move UI item validation to UserInterfaceItemCommandHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@commandexecute
Patch Set: Properly release |commandHandler|. 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
« no previous file with comments | « ui/base/cocoa/command_dispatcher.h ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_COCOA_USER_INTERFACE_ITEM_COMMAND_HANDLER_H_
6 #define UI_BASE_COCOA_USER_INTERFACE_ITEM_COMMAND_HANDLER_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 // Used by CommandDispatchingWindow to implement NSUserInterfaceItemValidations
11 // for items with -commandDispatch: and -commandDispatchUsingKeyModifiers:.
12 @protocol UserInterfaceItemCommandHandler<NSObject>
13
14 // Called by CommandDispatchingWindow to validate menu and toolbar items. All
15 // the items we care about have been set with the -commandDispatch or
16 // -commandDispatchUsingKeyModifiers selectors and a target of FirstResponder in
17 // IB. If it's not one of those, it should be handled elsewhere in the responder
18 // chain.
19 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item
20 window:(NSWindow*)window;
21
22 // Called by CommandDispatchingWindow to execute commands. This assumes that the
23 // command is supported and doesn't check, otherwise it would have been disabled
24 // in the UI in validateUserInterfaceItem:.
25 - (void)commandDispatch:(id)sender window:(NSWindow*)window;
26
27 // Same as |-commandDispatch:|, but executes commands using a disposition
28 // determined by the key flags. If the window is in the background and the
29 // command key is down, ignore the command key, but process any other modifiers.
30 - (void)commandDispatchUsingKeyModifiers:(id)sender window:(NSWindow*)window;
31
32 @end
33
34 #endif // UI_BASE_COCOA_USER_INTERFACE_ITEM_COMMAND_HANDLER_H_
OLDNEW
« no previous file with comments | « ui/base/cocoa/command_dispatcher.h ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698