Infobar material design refresh: layout
[chromium-blink-merge.git] / chrome / browser / ui / views / apps / desktop_keyboard_capture.h
blob3055d55aec93de3594a04609188db96828678cf1
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_
6 #define CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_
8 #include "ui/views/widget/widget.h"
9 #include "ui/views/widget/widget_observer.h"
11 // This class installs/uninstalls keyboard hook as the widget activation
12 // changes.
13 class DesktopKeyboardCapture : public views::WidgetObserver {
14 public:
15 explicit DesktopKeyboardCapture(views::Widget* widget);
16 ~DesktopKeyboardCapture() override;
18 private:
19 // views::WidgetObserver implementation.
20 void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
22 void RegisterKeyboardHooks();
23 void DeregisterKeyboardHooks();
25 // The widget registering for keyboard intercept. Weak reference.
26 views::Widget* widget_;
28 // Current state of keyboard intercept registration.
29 bool is_registered_;
31 DISALLOW_COPY_AND_ASSIGN(DesktopKeyboardCapture);
34 #endif // CHROME_BROWSER_UI_VIEWS_APPS_DESKTOP_KEYBOARD_CAPTURE_H_