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..67ada5abe1d0d20e0320cc389ac79707561361e9 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h |
| @@ -0,0 +1,45 @@ |
| +// 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 InitializeHandler() OVERRIDE; |
| + virtual void InitializePage() OVERRIDE; |
| + |
| + private: |
| + // SystemClockClient::Observer: |
| + virtual void SystemClockCanSetTimeChanged(bool can_set_time) OVERRIDE; |
| + |
| + // Callback for the "showSetTime" message to show the set time dialog. No |
| + // arguments are expected. |
| + void HandleShowSetTime(const base::ListValue* args); |
| + |
| + // Only expose the button and dialog of the system time can be set. |
|
michaelpg
2014/04/24 22:42:48
s/of/if
michaelpg
2014/04/25 20:05:14
Done.
|
| + 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_ |