| 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/ui/webui/chromeos/login/network_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 } else { | 305 } else { |
| 306 self->selected_language_code_ = | 306 self->selected_language_code_ = |
| 307 CalculateSelectedLanguage(requested_locale, loaded_locale); | 307 CalculateSelectedLanguage(requested_locale, loaded_locale); |
| 308 } | 308 } |
| 309 } else { | 309 } else { |
| 310 self->selected_language_code_ = loaded_locale; | 310 self->selected_language_code_ = loaded_locale; |
| 311 } | 311 } |
| 312 | 312 |
| 313 self->ReloadLocalizedContent(); | 313 self->ReloadLocalizedContent(); |
| 314 | 314 |
| 315 // We still do not have device owner, so owner settings are not applied. |
| 316 // But Guest session can be started before owner is created, so we need to |
| 317 // save locale settings directly here. |
| 318 g_browser_process->local_state()->SetString(prefs::kApplicationLocale, |
| 319 self->selected_language_code_); |
| 320 |
| 315 AccessibilityManager::Get()->OnLocaleChanged(); | 321 AccessibilityManager::Get()->OnLocaleChanged(); |
| 316 } | 322 } |
| 317 | 323 |
| 318 void NetworkScreenHandler::HandleOnLanguageChanged(const std::string& locale) { | 324 void NetworkScreenHandler::HandleOnLanguageChanged(const std::string& locale) { |
| 319 const std::string app_locale = g_browser_process->GetApplicationLocale(); | 325 const std::string app_locale = g_browser_process->GetApplicationLocale(); |
| 320 if (app_locale == locale) | 326 if (app_locale == locale) |
| 321 return; | 327 return; |
| 322 | 328 |
| 323 base::WeakPtr<NetworkScreenHandler> weak_self = | 329 base::WeakPtr<NetworkScreenHandler> weak_self = |
| 324 weak_ptr_factory_.GetWeakPtr(); | 330 weak_ptr_factory_.GetWeakPtr(); |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 timezone_option->SetString("value", timezone_id); | 629 timezone_option->SetString("value", timezone_id); |
| 624 timezone_option->SetString("title", timezone_name); | 630 timezone_option->SetString("title", timezone_name); |
| 625 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); | 631 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); |
| 626 timezone_list->Append(timezone_option.release()); | 632 timezone_list->Append(timezone_option.release()); |
| 627 } | 633 } |
| 628 | 634 |
| 629 return timezone_list.release(); | 635 return timezone_list.release(); |
| 630 } | 636 } |
| 631 | 637 |
| 632 } // namespace chromeos | 638 } // namespace chromeos |
| OLD | NEW |