OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_KEYBOARD_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_KEYBOARD_HANDLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" |
| 10 #include "ui/events/devices/input_device_event_observer.h" |
| 11 |
| 12 namespace base { |
| 13 class ListValue; |
| 14 } |
| 15 |
| 16 namespace content { |
| 17 class WebUI; |
| 18 } |
| 19 |
| 20 class Profile; |
| 21 |
| 22 namespace chromeos { |
| 23 namespace settings { |
| 24 |
| 25 // Chrome OS "Keyboard" settings page UI handler. |
| 26 class KeyboardHandler |
| 27 : public ::settings::SettingsPageUIHandler, |
| 28 public ui::InputDeviceEventObserver { |
| 29 public: |
| 30 explicit KeyboardHandler(content::WebUI* webui); |
| 31 ~KeyboardHandler() override; |
| 32 |
| 33 // SettingsPageUIHandler implementation. |
| 34 void RegisterMessages() override; |
| 35 |
| 36 // ui::InputDeviceEventObserver implementation. |
| 37 void OnKeyboardDeviceConfigurationChanged() override; |
| 38 |
| 39 private: |
| 40 // Initializes the page with the current keyboard information. |
| 41 void HandleInitialize(const base::ListValue* args); |
| 42 |
| 43 // Shows or hides the Caps Lock and Diamond key settings based on whether the |
| 44 // system status. |
| 45 void UpdateShowKeys() const; |
| 46 |
| 47 Profile* profile_; // Weak pointer. |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(KeyboardHandler); |
| 50 }; |
| 51 |
| 52 } // namespace settings |
| 53 } // namespace chromeos |
| 54 |
| 55 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_KEYBOARD_HANDLER_H_ |
OLD | NEW |