OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SYSTEM_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SYSTEM_OPTIONS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SYSTEM_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SYSTEM_OPTIONS_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/chromeos/device_hierarchy_observer.h" |
11 #include "chrome/browser/ui/webui/options/options_ui.h" | 12 #include "chrome/browser/ui/webui/options/options_ui.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class DictionaryValue; | 15 class DictionaryValue; |
15 } | 16 } |
16 | 17 |
17 // ChromeOS system options page UI handler. | 18 // ChromeOS system options page UI handler. |
18 class SystemOptionsHandler | 19 class SystemOptionsHandler |
19 : public OptionsPageUIHandler, | 20 : public OptionsPageUIHandler, |
| 21 public chromeos::DeviceHierarchyObserver, |
20 public base::SupportsWeakPtr<SystemOptionsHandler> { | 22 public base::SupportsWeakPtr<SystemOptionsHandler> { |
21 public: | 23 public: |
22 SystemOptionsHandler(); | 24 SystemOptionsHandler(); |
23 virtual ~SystemOptionsHandler(); | 25 virtual ~SystemOptionsHandler(); |
24 | 26 |
25 // OptionsPageUIHandler implementation. | 27 // OptionsPageUIHandler implementation. |
26 virtual void GetLocalizedValues( | 28 virtual void GetLocalizedValues( |
27 base::DictionaryValue* localized_strings) OVERRIDE; | 29 base::DictionaryValue* localized_strings) OVERRIDE; |
28 virtual void Initialize() OVERRIDE; | 30 virtual void Initialize() OVERRIDE; |
29 | 31 |
30 virtual void RegisterMessages() OVERRIDE; | 32 virtual void RegisterMessages() OVERRIDE; |
31 | 33 |
| 34 // DeviceHierarchyObserver implementation. |
| 35 virtual void DeviceHierarchyChanged() OVERRIDE; |
| 36 |
32 // Called when the accessibility checkbox value is changed. | 37 // Called when the accessibility checkbox value is changed. |
33 // |args| will contain the checkbox checked state as a string | 38 // |args| will contain the checkbox checked state as a string |
34 // ("true" or "false"). | 39 // ("true" or "false"). |
35 void AccessibilityChangeCallback(const base::ListValue* args); | 40 void AccessibilityChangeCallback(const base::ListValue* args); |
36 | 41 |
37 // Called when the System configuration screen is used to adjust | 42 // Called when the System configuration screen is used to adjust |
38 // the screen brightness. | 43 // the screen brightness. |
39 // |args| will be an empty list. | 44 // |args| will be an empty list. |
40 void DecreaseScreenBrightnessCallback(const base::ListValue* args); | 45 void DecreaseScreenBrightnessCallback(const base::ListValue* args); |
41 void IncreaseScreenBrightnessCallback(const base::ListValue* args); | 46 void IncreaseScreenBrightnessCallback(const base::ListValue* args); |
42 | 47 |
43 private: | 48 private: |
44 // Callback for TouchpadHelper. | 49 // Check for input devices. |
| 50 void CheckTouchpadExists(); |
| 51 void CheckMouseExists(); |
| 52 |
| 53 // Callback for input device checks. |
45 void TouchpadExists(bool* exists); | 54 void TouchpadExists(bool* exists); |
| 55 void MouseExists(bool* exists); |
46 | 56 |
47 DISALLOW_COPY_AND_ASSIGN(SystemOptionsHandler); | 57 DISALLOW_COPY_AND_ASSIGN(SystemOptionsHandler); |
48 }; | 58 }; |
49 | 59 |
50 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SYSTEM_OPTIONS_HANDLER_H_ | 60 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_SYSTEM_OPTIONS_HANDLER_H_ |
OLD | NEW |