Chromium Code Reviews| Index: chrome/browser/ui/views/apps/desktop_keyboard_capture.h |
| diff --git a/chrome/browser/ui/views/apps/desktop_keyboard_capture.h b/chrome/browser/ui/views/apps/desktop_keyboard_capture.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..15e58fc55ea6869207a1b74ac37d890681ad8d97 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/apps/desktop_keyboard_capture.h |
| @@ -0,0 +1,34 @@ |
| +// Copyright (c) 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_DESKTOP_KEYBOARD_CAPTURE_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_ |
| + |
| +#include "ui/views/widget/widget.h" |
| +#include "ui/views/widget/widget_observer.h" |
| + |
| +// This class maintains registration of keyboard hooks and routing the low level |
| +// callback. |
|
sadrul
2014/11/18 22:21:46
Mention that the hooks are installed/uninstalled a
Sriram
2014/11/18 22:45:43
Done.
|
| +class DesktopKeyboardCapture : public views::WidgetObserver { |
| + public: |
| + explicit DesktopKeyboardCapture(views::Widget* widget); |
| + ~DesktopKeyboardCapture(); |
| + |
| + private: |
| + // views::WidgetObserver implementation. |
| + void OnWidgetActivationChanged(views::Widget* widget, bool active) override; |
| + |
| + void RegisterKeyboardHooks(); |
| + void DeregisterKeyboardHooks(); |
| + |
| + // The widget registering for keyboard intercept. Weak reference. |
| + views::Widget* widget_; |
| + |
| + // Current state of keyboard intercept registration. |
| + bool is_registered_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DesktopKeyboardCapture); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_ |