| 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 #include "chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/date_time_options_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/set_time_dialog.h" | 10 #include "chrome/browser/chromeos/set_time_dialog.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 DBusThreadManager::Get()->GetSystemClockClient()->RemoveObserver(this); | 26 DBusThreadManager::Get()->GetSystemClockClient()->RemoveObserver(this); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void DateTimeOptionsHandler::GetLocalizedValues( | 29 void DateTimeOptionsHandler::GetLocalizedValues( |
| 30 base::DictionaryValue* localized_strings) { | 30 base::DictionaryValue* localized_strings) { |
| 31 DCHECK(localized_strings); | 31 DCHECK(localized_strings); |
| 32 | 32 |
| 33 localized_strings->SetString( | 33 localized_strings->SetString( |
| 34 "setTimeButton", | 34 "setTimeButton", |
| 35 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SET_TIME_BUTTON)); | 35 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_SET_TIME_BUTTON)); |
| 36 localized_strings->SetString( | |
| 37 "timeSyncedExplanation", | |
| 38 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_TIME_SYNCED_EXPLANATION)); | |
| 39 } | 36 } |
| 40 | 37 |
| 41 void DateTimeOptionsHandler::InitializeHandler() { | 38 void DateTimeOptionsHandler::InitializeHandler() { |
| 42 SystemClockClient* system_clock_client = | 39 SystemClockClient* system_clock_client = |
| 43 DBusThreadManager::Get()->GetSystemClockClient(); | 40 DBusThreadManager::Get()->GetSystemClockClient(); |
| 44 system_clock_client->AddObserver(this); | 41 system_clock_client->AddObserver(this); |
| 45 | 42 |
| 46 can_set_time_ = system_clock_client->CanSetTime(); | 43 can_set_time_ = system_clock_client->CanSetTime(); |
| 47 SystemClockCanSetTimeChanged(can_set_time_); | 44 SystemClockCanSetTimeChanged(can_set_time_); |
| 48 } | 45 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 71 void DateTimeOptionsHandler::HandleShowSetTime(const base::ListValue* args) { | 68 void DateTimeOptionsHandler::HandleShowSetTime(const base::ListValue* args) { |
| 72 // Make sure the clock status hasn't changed since the button was clicked. | 69 // Make sure the clock status hasn't changed since the button was clicked. |
| 73 if (can_set_time_) { | 70 if (can_set_time_) { |
| 74 SetTimeDialog::ShowDialog( | 71 SetTimeDialog::ShowDialog( |
| 75 web_ui()->GetWebContents()->GetTopLevelNativeWindow()); | 72 web_ui()->GetWebContents()->GetTopLevelNativeWindow()); |
| 76 } | 73 } |
| 77 } | 74 } |
| 78 | 75 |
| 79 } // namespace options | 76 } // namespace options |
| 80 } // namespace chromeos | 77 } // namespace chromeos |
| OLD | NEW |