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

Unified Diff: chrome/browser/ui/cocoa/chrome_event_processing_window.h

Issue 1255783002: [Mac] Factor out keyboard shortcut handling from ChromeEventProcessingWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@execute
Patch Set: UI_BASE_EXPORT CommandDispatcher Created 5 years, 4 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: chrome/browser/ui/cocoa/chrome_event_processing_window.h
diff --git a/chrome/browser/ui/cocoa/chrome_event_processing_window.h b/chrome/browser/ui/cocoa/chrome_event_processing_window.h
index 0f6dfb1dfc2565757528a5cc86284cdcd07697d8..a5f65cb1003ac0e3ad2bfa77c054541d3cd3d358 100644
--- a/chrome/browser/ui/cocoa/chrome_event_processing_window.h
+++ b/chrome/browser/ui/cocoa/chrome_event_processing_window.h
@@ -7,33 +7,23 @@
#import <Cocoa/Cocoa.h>
+#import "base/mac/scoped_nsobject.h"
+#import "ui/base/cocoa/command_dispatcher.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
+@class ChromeCommandDispatcherDelegate;
+
// Override NSWindow to access unhandled keyboard events (for command
// processing); subclassing NSWindow is the only method to do
// this.
-@interface ChromeEventProcessingWindow : UnderlayOpenGLHostingWindow {
- @private
- BOOL redispatchingEvent_;
- BOOL eventHandled_;
-}
-
-// Sends a key event to |NSApp sendEvent:|, but also makes sure that it's not
-// short-circuited to the RWHV. This is used to send keyboard events to the menu
-// and the cmd-` handler if a keyboard event comes back unhandled from the
-// renderer. The event must be of type |NSKeyDown|, |NSKeyUp|, or
-// |NSFlagsChanged|.
-// Returns |YES| if |event| has been handled.
-- (BOOL)redispatchKeyEvent:(NSEvent*)event;
+@interface ChromeEventProcessingWindow
+ : UnderlayOpenGLHostingWindow<CommandDispatchingWindow>
// Checks if |event| is a window, delayed window, or browser keyboard shortcut.
// (See global_keyboard_shortcuts_mac.h for details). If so, execute the
// associated command. Returns YES if the event was handled.
- (BOOL)handleExtraKeyboardShortcut:(NSEvent*)event;
-// Override, so we can handle global keyboard events.
-- (BOOL)performKeyEquivalent:(NSEvent*)theEvent;
-
@end
#endif // CHROME_BROWSER_UI_COCOA_CHROME_EVENT_PROCESSING_WINDOW_H_

Powered by Google App Engine
This is Rietveld 408576698