OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DATE_TIME_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/ui/webui/options/options_ui.h" | 9 #include "chrome/browser/ui/webui/options/options_ui.h" |
10 #include "chromeos/dbus/system_clock_client.h" | 10 #include "chromeos/dbus/system_clock_client.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 namespace options { | 13 namespace options { |
14 | 14 |
15 // Chrome OS handler for the set date/time link in the Advanced settings page. | 15 // Chrome OS handler for the set date/time link in the Advanced settings page. |
16 class DateTimeOptionsHandler : public ::options::OptionsPageUIHandler, | 16 class DateTimeOptionsHandler : public ::options::OptionsPageUIHandler, |
17 public SystemClockClient::Observer { | 17 public SystemClockClient::Observer { |
18 public: | 18 public: |
19 DateTimeOptionsHandler(); | 19 DateTimeOptionsHandler(); |
20 virtual ~DateTimeOptionsHandler(); | 20 virtual ~DateTimeOptionsHandler(); |
21 | 21 |
22 // OptionsPageUIHandler: | 22 // OptionsPageUIHandler: |
23 virtual void GetLocalizedValues( | 23 virtual void GetLocalizedValues( |
24 base::DictionaryValue* localized_strings) OVERRIDE; | 24 base::DictionaryValue* localized_strings) override; |
25 virtual void InitializeHandler() OVERRIDE; | 25 virtual void InitializeHandler() override; |
26 virtual void InitializePage() OVERRIDE; | 26 virtual void InitializePage() override; |
27 virtual void RegisterMessages() OVERRIDE; | 27 virtual void RegisterMessages() override; |
28 | 28 |
29 private: | 29 private: |
30 // SystemClockClient::Observer: | 30 // SystemClockClient::Observer: |
31 virtual void SystemClockCanSetTimeChanged(bool can_set_time) OVERRIDE; | 31 virtual void SystemClockCanSetTimeChanged(bool can_set_time) override; |
32 | 32 |
33 // Callback for the "showSetTime" message to show the set time dialog. No | 33 // Callback for the "showSetTime" message to show the set time dialog. No |
34 // arguments are expected. | 34 // arguments are expected. |
35 void HandleShowSetTime(const base::ListValue* args); | 35 void HandleShowSetTime(const base::ListValue* args); |
36 | 36 |
37 // Only expose the button and dialog if the system time can be set. | 37 // Only expose the button and dialog if the system time can be set. |
38 bool can_set_time_; | 38 bool can_set_time_; |
39 bool page_initialized_; | 39 bool page_initialized_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(DateTimeOptionsHandler); | 41 DISALLOW_COPY_AND_ASSIGN(DateTimeOptionsHandler); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace options | 44 } // namespace options |
45 } // namespace chromeos | 45 } // namespace chromeos |
46 | 46 |
47 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ | 47 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ |
OLD | NEW |