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

Unified Diff: chrome/browser/ui/views/apps/keyboard_hook_handler.h

Issue 297123002: API proposal for chrome.app.window to intercept all keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update based on Ben's CR comments Created 6 years, 1 month 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/views/apps/keyboard_hook_handler.h
diff --git a/chrome/browser/ui/views/apps/keyboard_hook_handler.h b/chrome/browser/ui/views/apps/keyboard_hook_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1412c01627e37a9ed4f21826492a98f5ff01075
--- /dev/null
+++ b/chrome/browser/ui/views/apps/keyboard_hook_handler.h
@@ -0,0 +1,23 @@
+// Copyright 2014 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 CHROME_BROWSER_UI_VIEWS_APPS_KEYBOARD_HOOK_HANDLER_H_
+#define CHROME_BROWSER_UI_VIEWS_APPS_KEYBOARD_HOOK_HANDLER_H_
+
+#include "ui/views/widget/widget.h"
+
+// Interface to control keyboard hook on different platform.
+class KeyboardHookHandler {
+ public:
+ // Request all keyboard events to be routed to the given window.
+ void Register(views::Widget* widget);
+
+ // Release the request for all keyboard events.
+ void Deregister(views::Widget* widget);
+
+ // Implemented in platform specific code.
+ static KeyboardHookHandler* GetInstance();
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_APPS_KEYBOARD_HOOK_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698