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/system/timezone_util.h" | |
23 #include "chrome/browser/profiles/profile_manager.h" | 24 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
26 #include "chrome/grit/chromium_strings.h" | 27 #include "chrome/grit/chromium_strings.h" |
27 #include "chrome/grit/generated_resources.h" | 28 #include "chrome/grit/generated_resources.h" |
28 #include "chromeos/network/network_handler.h" | 29 #include "chromeos/network/network_handler.h" |
29 #include "chromeos/network/network_state_handler.h" | 30 #include "chromeos/network/network_state_handler.h" |
30 #include "components/prefs/pref_service.h" | 31 #include "components/prefs/pref_service.h" |
31 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
32 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 | 126 |
126 std::string NetworkScreen::GetApplicationLocale() { | 127 std::string NetworkScreen::GetApplicationLocale() { |
127 return g_browser_process->GetApplicationLocale(); | 128 return g_browser_process->GetApplicationLocale(); |
128 } | 129 } |
129 | 130 |
130 std::string NetworkScreen::GetInputMethod() const { | 131 std::string NetworkScreen::GetInputMethod() const { |
131 return input_method_; | 132 return input_method_; |
132 } | 133 } |
133 | 134 |
134 void NetworkScreen::SetTimezone(const std::string& timezone_id) { | 135 void NetworkScreen::SetTimezone(const std::string& timezone_id) { |
135 std::string current_timezone_id; | 136 if (system::PerUserTimezoneEnabled()) { |
136 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); | 137 if (timezone_id.empty()) |
137 if (current_timezone_id == timezone_id || timezone_id.empty()) | 138 return; |
138 return; | 139 |
139 timezone_ = timezone_id; | 140 timezone_ = timezone_id; |
140 CrosSettings::Get()->SetString(kSystemTimezone, timezone_id); | 141 chromeos::system::SetSystemAndSigninScreenTimezone(timezone_id); |
stevenjb
2017/05/25 22:13:06
Could we make this do the test and call CrosSettin
Alexander Alekseev
2017/05/29 21:10:23
SetSystemAndSigninScreenTimezone() is setting time
stevenjb
2017/05/30 16:47:18
I was suggesting:
SetSystemAndSigninScreenTimezon
Alexander Alekseev
2017/07/06 06:30:28
You're righ. Even more, SetSystemAndSigninScreenTi
| |
142 } else { | |
143 std::string current_timezone_id; | |
144 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); | |
145 if (current_timezone_id == timezone_id || timezone_id.empty()) | |
146 return; | |
147 timezone_ = timezone_id; | |
148 CrosSettings::Get()->SetString(kSystemTimezone, timezone_id); | |
149 } | |
141 } | 150 } |
142 | 151 |
143 std::string NetworkScreen::GetTimezone() const { | 152 std::string NetworkScreen::GetTimezone() const { |
144 return timezone_; | 153 return timezone_; |
145 } | 154 } |
146 | 155 |
147 void NetworkScreen::GetConnectedWifiNetwork(std::string* out_onc_spec) { | 156 void NetworkScreen::GetConnectedWifiNetwork(std::string* out_onc_spec) { |
148 // Currently We can only transfer unsecured WiFi configuration from shark to | 157 // Currently We can only transfer unsecured WiFi configuration from shark to |
149 // remora. There is no way to get password for a secured Wifi network in Cros | 158 // remora. There is no way to get password for a secured Wifi network in Cros |
150 // for security reasons. | 159 // for security reasons. |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 observer.OnLanguageListReloaded(); | 450 observer.OnLanguageListReloaded(); |
442 } | 451 } |
443 | 452 |
444 void NetworkScreen::OnSystemTimezoneChanged() { | 453 void NetworkScreen::OnSystemTimezoneChanged() { |
445 std::string current_timezone_id; | 454 std::string current_timezone_id; |
446 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); | 455 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); |
447 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); | 456 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); |
448 } | 457 } |
449 | 458 |
450 } // namespace chromeos | 459 } // namespace chromeos |
OLD | NEW |