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

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

Issue 1255783002: [Mac] Factor out keyboard shortcut handling from ChromeEventProcessingWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@execute
Patch Set: Fix a few things. Created 5 years, 5 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
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_

Powered by Google App Engine
This is Rietveld 408576698