Index: ui/base/cocoa/command_dispatch_delegate.h |
diff --git a/ui/base/cocoa/command_dispatch_delegate.h b/ui/base/cocoa/command_dispatch_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6979fbc5ad0d6bd2cdcd2fcb91bd478c2f777396 |
--- /dev/null |
+++ b/ui/base/cocoa/command_dispatch_delegate.h |
@@ -0,0 +1,29 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_BASE_COCOA_COMMAND_DISPATCH_DELEGATE_H_ |
+#define UI_BASE_COCOA_COMMAND_DISPATCH_DELEGATE_H_ |
+ |
+#import <Cocoa/Cocoa.h> |
+ |
+// Handle routing of keyboard events. |
+@protocol CommandDispatchDelegate |
tapted
2015/07/31 03:06:50
hm - I imagined this as a regular @interface with
jackhou1
2015/08/04 01:03:59
Yeah, CEPW and NativeWidgetMacNSWindow only need t
|
+ |
+// Handles various keyboard shortcuts hooks before and after native |
+// -performKeyEquivalent. Returns YES if the event is handled. |
+- (BOOL)performKeyEquivalent:(NSEvent*)event |
+ window:(NSWindow*)window |
+ nativeHandler:(BOOL (^)(NSEvent*))nativePerformKeyEquivalent; |
+ |
+// Send the event to NSApp so it can be handled natively. Ensures that the event |
+// is not reposted infinitely. |
+- (BOOL)redispatchKeyEvent:(NSEvent*)event window:(NSWindow*)window; |
+ |
+// Called before a native -sendEvent. Returns NO if handling of this event |
tapted
2015/07/31 03:06:50
Flip condition - it's currentlt the reverse of per
jackhou1
2015/08/04 01:03:58
Done.
|
+// should stop. |
+- (BOOL)preSendEvent:(NSEvent*)event; |
+ |
+@end |
+ |
+#endif // UI_BASE_COCOA_COMMAND_DISPATCH_DELEGATE_H_ |