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

Side by Side Diff: chrome/browser/ui/views/apps/desktop_keyboard_capture.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: Use WidgetObserver instead of plumbing SetKeyboardIntercept through view::Widget 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698