OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/screens/network_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/network_screen.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chromeos/base/locale_util.h" | 14 #include "chrome/browser/chromeos/base/locale_util.h" |
15 #include "chrome/browser/chromeos/customization/customization_document.h" | 15 #include "chrome/browser/chromeos/customization/customization_document.h" |
16 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 16 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
17 #include "chrome/browser/chromeos/login/helper.h" | 17 #include "chrome/browser/chromeos/login/helper.h" |
18 #include "chrome/browser/chromeos/login/screen_manager.h" | 18 #include "chrome/browser/chromeos/login/screen_manager.h" |
19 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 19 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
20 #include "chrome/browser/chromeos/login/screens/network_view.h" | 20 #include "chrome/browser/chromeos/login/screens/network_view.h" |
21 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 21 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
22 #include "chrome/browser/chromeos/login/wizard_controller.h" | 22 #include "chrome/browser/chromeos/login/wizard_controller.h" |
23 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 23 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| 24 #include "chrome/browser/chromeos/system/timezone_util.h" |
24 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
25 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 26 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
27 #include "chrome/grit/chromium_strings.h" | 28 #include "chrome/grit/chromium_strings.h" |
28 #include "chrome/grit/generated_resources.h" | 29 #include "chrome/grit/generated_resources.h" |
29 #include "chromeos/network/network_handler.h" | 30 #include "chromeos/network/network_handler.h" |
30 #include "chromeos/network/network_state_handler.h" | 31 #include "chromeos/network/network_state_handler.h" |
31 #include "components/prefs/pref_service.h" | 32 #include "components/prefs/pref_service.h" |
32 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
33 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 127 |
127 std::string NetworkScreen::GetApplicationLocale() { | 128 std::string NetworkScreen::GetApplicationLocale() { |
128 return g_browser_process->GetApplicationLocale(); | 129 return g_browser_process->GetApplicationLocale(); |
129 } | 130 } |
130 | 131 |
131 std::string NetworkScreen::GetInputMethod() const { | 132 std::string NetworkScreen::GetInputMethod() const { |
132 return input_method_; | 133 return input_method_; |
133 } | 134 } |
134 | 135 |
135 void NetworkScreen::SetTimezone(const std::string& timezone_id) { | 136 void NetworkScreen::SetTimezone(const std::string& timezone_id) { |
136 std::string current_timezone_id; | 137 if (timezone_id.empty()) |
137 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); | |
138 if (current_timezone_id == timezone_id || timezone_id.empty()) | |
139 return; | 138 return; |
| 139 |
140 timezone_ = timezone_id; | 140 timezone_ = timezone_id; |
141 CrosSettings::Get()->SetString(kSystemTimezone, timezone_id); | 141 chromeos::system::SetSigninScreenTimezone(timezone_id, |
| 142 true /* set_system_timezone */); |
142 } | 143 } |
143 | 144 |
144 std::string NetworkScreen::GetTimezone() const { | 145 std::string NetworkScreen::GetTimezone() const { |
145 return timezone_; | 146 return timezone_; |
146 } | 147 } |
147 | 148 |
148 void NetworkScreen::GetConnectedWifiNetwork(std::string* out_onc_spec) { | 149 void NetworkScreen::GetConnectedWifiNetwork(std::string* out_onc_spec) { |
149 // Currently We can only transfer unsecured WiFi configuration from shark to | 150 // Currently We can only transfer unsecured WiFi configuration from shark to |
150 // remora. There is no way to get password for a secured Wifi network in Cros | 151 // remora. There is no way to get password for a secured Wifi network in Cros |
151 // for security reasons. | 152 // for security reasons. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 observer.OnLanguageListReloaded(); | 444 observer.OnLanguageListReloaded(); |
444 } | 445 } |
445 | 446 |
446 void NetworkScreen::OnSystemTimezoneChanged() { | 447 void NetworkScreen::OnSystemTimezoneChanged() { |
447 std::string current_timezone_id; | 448 std::string current_timezone_id; |
448 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); | 449 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); |
449 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); | 450 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); |
450 } | 451 } |
451 | 452 |
452 } // namespace chromeos | 453 } // namespace chromeos |
OLD | NEW |