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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_keyboard_capture_win.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: Sync to TOT Created 6 years, 4 months 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) 2012 The Chromium Authors. All rights reserved.
sadrul 2014/07/29 22:22:41 2014.5
Sriram 2014/07/31 00:21:13 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 UI_VIEWS_WIDGET_DESKTOP_KEYBOARD_CAPTURE_WIN_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_KEYBOARD_CAPTURE_WIN_H_
7
8 #include <map>
9
10 #include "base/containers/scoped_ptr_hash_map.h"
11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/views/views_export.h"
13
14 namespace base {
15 class Lock;
16 class TaskRunner;
17 }
18
19 namespace views {
20
21 class VIEWS_EXPORT DesktopKeyboardCaptureWin {
sadrul 2014/07/29 22:22:41 You probably want this to be a base::Singleton obj
Sriram 2014/07/31 00:21:13 Done.
22 public:
23 static void Capture(HWND window_handle, base::TaskRunner* task_runner);
24 static void Release(HWND window_handle);
25
26 private:
27 // Low level keyboard hook processing related functions.
28 // Hook callback called from the OS.
29 static LRESULT CALLBACK
30 KeyboardHook(int code, WPARAM w_param, LPARAM l_param);
31
32 static bool IsKeyUp(WPARAM w_param);
33 static bool IsBitSet(ULONG value, ULONG mask);
34 static DWORD RemoveLocationOnKeycode(DWORD vk_code);
35 static bool UpdateThreadKeyboardState();
36 static LPARAM GetLParamFromHookStruct(WPARAM w_param,
37 KBDLLHOOKSTRUCT hook_struct);
sadrul 2014/07/29 22:22:41 Please add comments on what these do
Sriram 2014/07/31 00:21:13 Done.
38
39 // Registration list related functions.
40 static bool AddToRegistrationList(HWND handle);
41 static void RegisterExistingHandle(HWND handle);
42 static bool IsRegistered(HWND handle);
43
44 class KeyboardInterceptRegistration;
45 static base::Lock registration_lock_;
46 static base::ScopedPtrHashMap<HWND, KeyboardInterceptRegistration>
47 registrations_;
48 };
49 }
50
51 #endif // UI_VIEWS_WIDGET_DESKTOP_KEYBOARD_CAPTURE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698