Chromium Code Reviews| Index: chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h |
| diff --git a/chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h b/chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..29ae076a2b3d326be035134801fdd2c552134fe2 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ |
| + |
| +#include "base/compiler_specific.h" |
| +#include "chrome/browser/ui/webui/options/options_ui.h" |
| +#include "chromeos/dbus/system_clock_client.h" |
| + |
| +namespace chromeos { |
| +namespace options { |
| + |
| +// Chrome OS handler for the set date/time link in the Advanced settings page. |
| +class DateTimeOptionsHandler : public ::options::OptionsPageUIHandler, |
| + public SystemClockClient::Observer { |
| + public: |
| + DateTimeOptionsHandler(); |
| + virtual ~DateTimeOptionsHandler(); |
| + |
| + // OptionsPageUIHandler: |
| + virtual void RegisterMessages() OVERRIDE; |
| + virtual void GetLocalizedValues( |
| + base::DictionaryValue* localized_strings) OVERRIDE; |
| + virtual void InitializeHandler() OVERRIDE; |
| + virtual void InitializePage() OVERRIDE; |
| + |
| + private: |
| + // SystemClockClient::Observer: |
| + virtual void SystemClockCanSetTimeChanged(bool can_set_time) OVERRIDE; |
|
Dan Beam
2014/04/23 17:51:45
nit: there is a school of folks that don't bother
|
| + |
| + // Callback for showing the set time dialog from the settings page. |
|
Dan Beam
2014/04/23 17:51:45
please mention which arguments this handler expect
michaelpg
2014/04/24 01:32:23
Done.
|
| + void HandleShowSetTime(const base::ListValue* args); |
| + |
| + // Only expose the button and dialog of the system time can be set. |
| + bool can_set_time_; |
| + bool page_initialized_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DateTimeOptionsHandler); |
| +}; |
| + |
| +} // namespace options |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DATE_TIME_OPTIONS_HANDLER_H_ |