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

Unified Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h

Issue 10911020: Enable commands API for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: filter by extension type instead of specific extensions Created 8 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/extensions/shell_window_cocoa.h
diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h
index 2169495e3778c429f162084826d06e11db74f1bf..39c7aecbb03aaa95e03e531febfccaabf7e423f9 100644
--- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h
+++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h
@@ -17,6 +17,7 @@
#import "third_party/GTM/AppKit/GTMWindowSheetController.h"
#include "ui/gfx/rect.h"
+class ExtensionKeybindingRegistryCocoa;
class Profile;
class ShellWindowCocoa;
@class ShellNSWindow;
@@ -36,6 +37,10 @@ class ShellWindowCocoa;
@property(assign, nonatomic) ShellWindowCocoa* shellWindow;
+// Consults the Command Registry to see if this |event| needs to be handled as
+// an extension command and returns YES if so (NO otherwise).
+- (BOOL)handledByExtensionCommand:(NSEvent*)event;
+
@end
// Cocoa bridge to ShellWindow.
@@ -73,6 +78,9 @@ class ShellWindowCocoa : public NativeShellWindow {
// Called when the window is defocused.
void WindowDidResignKey();
+ // Called to handle a key event.
+ bool HandledByExtensionCommand(NSEvent* event);
+
protected:
// NativeShellWindow implementation.
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
@@ -111,6 +119,10 @@ class ShellWindowCocoa : public NativeShellWindow {
std::vector<extensions::DraggableRegion> draggable_regions_;
+ // The Extension Command Registry used to determine which keyboard events to
+ // handle.
+ scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_;
+
DISALLOW_COPY_AND_ASSIGN(ShellWindowCocoa);
};

Powered by Google App Engine
This is Rietveld 408576698