Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/browser/chromeos/login/screens/network_screen.cc

Issue 2849823003: ChromeOS: implement per-user time zone preferences. (Closed)
Patch Set: Rebased. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/stl_util.h" 11 #include "base/stl_util.h"
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chromeos/base/locale_util.h" 15 #include "chrome/browser/chromeos/base/locale_util.h"
16 #include "chrome/browser/chromeos/customization/customization_document.h" 16 #include "chrome/browser/chromeos/customization/customization_document.h"
17 #include "chrome/browser/chromeos/login/help_app_launcher.h" 17 #include "chrome/browser/chromeos/login/help_app_launcher.h"
18 #include "chrome/browser/chromeos/login/helper.h" 18 #include "chrome/browser/chromeos/login/helper.h"
19 #include "chrome/browser/chromeos/login/screen_manager.h" 19 #include "chrome/browser/chromeos/login/screen_manager.h"
20 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" 20 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h"
21 #include "chrome/browser/chromeos/login/screens/network_view.h" 21 #include "chrome/browser/chromeos/login/screens/network_view.h"
22 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" 22 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h"
23 #include "chrome/browser/chromeos/login/wizard_controller.h" 23 #include "chrome/browser/chromeos/login/wizard_controller.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
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, &current_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::SetSystemAndSigninScreenTimezone(timezone_id);
142 } 142 }
143 143
144 std::string NetworkScreen::GetTimezone() const { 144 std::string NetworkScreen::GetTimezone() const {
145 return timezone_; 145 return timezone_;
146 } 146 }
147 147
148 void NetworkScreen::GetConnectedWifiNetwork(std::string* out_onc_spec) { 148 void NetworkScreen::GetConnectedWifiNetwork(std::string* out_onc_spec) {
149 // Currently We can only transfer unsecured WiFi configuration from shark to 149 // 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 150 // remora. There is no way to get password for a secured Wifi network in Cros
151 // for security reasons. 151 // for security reasons.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 observer.OnLanguageListReloaded(); 441 observer.OnLanguageListReloaded();
442 } 442 }
443 443
444 void NetworkScreen::OnSystemTimezoneChanged() { 444 void NetworkScreen::OnSystemTimezoneChanged() {
445 std::string current_timezone_id; 445 std::string current_timezone_id;
446 CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id); 446 CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id);
447 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); 447 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id);
448 } 448 }
449 449
450 } // namespace chromeos 450 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698