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