Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
|
benwells
2014/11/21 00:52:01
Nit: no (c)
Sriram
2014/11/21 05:35:21
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_ | |
| 7 | |
| 8 #include "ui/views/widget/widget.h" | |
| 9 #include "ui/views/widget/widget_observer.h" | |
| 10 | |
| 11 // This class maintains registration of keyboard hooks and routing the low level | |
| 12 // callback. | |
| 13 class DesktopKeyboardCapture: public views::WidgetObserver { | |
| 14 public: | |
| 15 explicit DesktopKeyboardCapture(views::Widget* widget); | |
| 16 ~DesktopKeyboardCapture(); | |
| 17 | |
| 18 private: | |
| 19 // views::WidgetObserver implementation. | |
| 20 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; | |
| 21 | |
| 22 void RegisterKeyboardHooks(); | |
| 23 void DeregisterKeyboardHooks(); | |
| 24 | |
| 25 // The widget registering for keyboard intercept. Weak reference. | |
| 26 views::Widget* widget_; | |
| 27 | |
| 28 // Current state of keyboard intercept registration. | |
| 29 bool is_registered_; | |
| 30 | |
| 31 DISALLOW_COPY_AND_ASSIGN(DesktopKeyboardCapture); | |
| 32 }; | |
| 33 | |
| 34 #endif // CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_ | |
| OLD | NEW |