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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/keyboard_handler.h

Issue 1188693002: Enable options to remap CapsLock whenever an external keyboard is connected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KEYBOARD_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KEYBOARD_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KEYBOARD_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KEYBOARD_HANDLER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/prefs/pref_member.h" 9 #include "base/prefs/pref_member.h"
10 #include "chrome/browser/ui/webui/options/options_ui.h" 10 #include "chrome/browser/ui/webui/options/options_ui.h"
11 #include "ui/events/devices/input_device_event_observer.h"
11 12
12 namespace chromeos { 13 namespace chromeos {
13 namespace options { 14 namespace options {
14 15
15 // Customize modifier keys overlay page UI handler. 16 // Customize modifier keys overlay page UI handler.
16 class KeyboardHandler : public ::options::OptionsPageUIHandler { 17 class KeyboardHandler
18 : public ::options::OptionsPageUIHandler,
19 public ui::InputDeviceEventObserver {
17 public: 20 public:
18 KeyboardHandler(); 21 KeyboardHandler();
19 ~KeyboardHandler() override; 22 ~KeyboardHandler() override;
20 23
21 // OptionsPageUIHandler implementation. 24 // OptionsPageUIHandler implementation.
22 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; 25 void GetLocalizedValues(base::DictionaryValue* localized_strings) override;
23 void InitializePage() override; 26 void InitializePage() override;
24 void RegisterMessages() override; 27 void RegisterMessages() override;
25 28
29 // ui::InputDeviceEventObserver:
30 void OnKeyboardDeviceConfigurationChanged() override;
31
26 private: 32 private:
27 // Show the keyboard shortcuts overlay from the options page. 33 // Show the keyboard shortcuts overlay from the options page.
28 void HandleShowKeyboardShortcuts(const base::ListValue* args); 34 void HandleShowKeyboardShortcuts(const base::ListValue* args);
29 35
36 // Shows or hides the CapsLock options based on whether or not there is an
37 // external keyboard connected.
38 void UpdateCapsLockOptions() const;
39
30 DISALLOW_COPY_AND_ASSIGN(KeyboardHandler); 40 DISALLOW_COPY_AND_ASSIGN(KeyboardHandler);
31 }; 41 };
32 42
33 } // namespace options 43 } // namespace options
34 } // namespace chromeos 44 } // namespace chromeos
35 45
36 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KEYBOARD_HANDLER_H_ 46 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KEYBOARD_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698