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

Unified Diff: ui/base/cocoa/command_dispatcher.h

Issue 2666523002: Allow permission bubbles to participate in key event dispatch as if they were a Browser. (Closed)
Patch Set: comments, fix permission->type missed in a refactor Created 3 years, 11 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | ui/base/cocoa/command_dispatcher.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/command_dispatcher.h
diff --git a/ui/base/cocoa/command_dispatcher.h b/ui/base/cocoa/command_dispatcher.h
index 0212d1e2ccc505a070cea14729eb8366e1945cfa..efcf8b0917a007b97837ac90181d9569f49c86c3 100644
--- a/ui/base/cocoa/command_dispatcher.h
+++ b/ui/base/cocoa/command_dispatcher.h
@@ -32,6 +32,11 @@ UI_BASE_EXPORT @interface CommandDispatcher : NSObject
// YES if the event is handled.
- (BOOL)performKeyEquivalent:(NSEvent*)event;
+// Validate a user interface item (e.g. an NSMenuItem), consulting |handler| for
+// -commandDispatch: item actions.
+- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item
+ forHandler:(id<UserInterfaceItemCommandHandler>)handler;
+
// Sends a key event to -[NSApp sendEvent:]. This is used to allow default
// AppKit handling of an event that comes back from CommandDispatcherTarget,
// e.g. key equivalents in the menu, or window manager commands like Cmd+`. Once
@@ -45,6 +50,13 @@ UI_BASE_EXPORT @interface CommandDispatcher : NSObject
// reposted infinitely. Returns YES if the event is handled.
- (BOOL)preSendEvent:(NSEvent*)event;
+// Dispatch a -commandDispatch: action either to |handler| or a parent window's
+// handler.
+- (void)dispatch:(id)sender
+ forHandler:(id<UserInterfaceItemCommandHandler>)handler;
+- (void)dispatchUsingKeyModifiers:(id)sender
+ forHandler:(id<UserInterfaceItemCommandHandler>)handler;
+
@end
// If the NSWindow's firstResponder implements CommandDispatcherTarget, it is
@@ -95,6 +107,9 @@ UI_BASE_EXPORT @interface CommandDispatcher : NSObject
// CommandDispatcher calls as part of its -performKeyEquivalent: flow.
- (BOOL)defaultPerformKeyEquivalent:(NSEvent*)event;
+// Short-circuit to the default -validateUserInterfaceItem: implementation.
+- (BOOL)defaultValidateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item;
+
// AppKit will call -[NSUserInterfaceValidations validateUserInterfaceItem:] to
// validate UI items. Any item whose target is FirstResponder, or nil, will
// traverse the responder chain looking for a responder that implements the
« no previous file with comments | « chrome/test/BUILD.gn ('k') | ui/base/cocoa/command_dispatcher.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698