OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 locale = controller->GetCustomization()->initial_locale(); | 957 locale = controller->GetCustomization()->initial_locale(); |
958 VLOG(1) << "Initial locale: " << locale; | 958 VLOG(1) << "Initial locale: " << locale; |
959 if (!locale.empty()) { | 959 if (!locale.empty()) { |
960 // Reloading resource bundle causes us to do blocking IO on UI thread. | 960 // Reloading resource bundle causes us to do blocking IO on UI thread. |
961 // Temporarily allow it until we fix http://crosbug.com/11102 | 961 // Temporarily allow it until we fix http://crosbug.com/11102 |
962 base::ThreadRestrictions::ScopedAllowIO allow_io; | 962 base::ThreadRestrictions::ScopedAllowIO allow_io; |
963 const std::string loaded_locale = | 963 const std::string loaded_locale = |
964 ResourceBundle::ReloadSharedInstance(locale); | 964 ResourceBundle::ReloadSharedInstance(locale); |
965 CHECK(!loaded_locale.empty()) << "Locale could not be found for " | 965 CHECK(!loaded_locale.empty()) << "Locale could not be found for " |
966 << locale; | 966 << locale; |
| 967 // Set the application locale here so that the language switch |
| 968 // menu works properly with the newly loaded locale. |
| 969 g_browser_process->SetApplicationLocale(loaded_locale); |
967 } | 970 } |
968 } | 971 } |
969 } | 972 } |
970 | 973 |
971 controller->ShowBackground(screen_bounds); | 974 controller->ShowBackground(screen_bounds); |
972 controller->Init(first_screen_name, screen_bounds); | 975 controller->Init(first_screen_name, screen_bounds); |
973 controller->Show(); | 976 controller->Show(); |
974 | 977 |
975 chromeos::LoginUtils::Get()->PrewarmAuthentication(); | 978 chromeos::LoginUtils::Get()->PrewarmAuthentication(); |
976 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) | 979 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) |
977 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); | 980 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); |
978 | 981 |
979 if (controller->GetCustomization()) { | 982 if (controller->GetCustomization()) { |
980 if (!locale.empty()) | |
981 chromeos::LanguageSwitchMenu::SwitchLanguage(locale); | |
982 | |
983 // Set initial timezone if specified by customization. | 983 // Set initial timezone if specified by customization. |
984 const std::string timezone_name = | 984 const std::string timezone_name = |
985 controller->GetCustomization()->initial_timezone(); | 985 controller->GetCustomization()->initial_timezone(); |
986 VLOG(1) << "Initial time zone: " << timezone_name; | 986 VLOG(1) << "Initial time zone: " << timezone_name; |
987 // Apply locale customizations only once so preserve whatever locale | 987 // Apply locale customizations only once so preserve whatever locale |
988 // user has changed to during OOBE. | 988 // user has changed to during OOBE. |
989 if (!timezone_name.empty()) { | 989 if (!timezone_name.empty()) { |
990 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( | 990 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( |
991 icu::UnicodeString::fromUTF8(timezone_name)); | 991 icu::UnicodeString::fromUTF8(timezone_name)); |
992 chromeos::CrosLibrary::Get()->GetSystemLibrary()->SetTimezone(timezone); | 992 chromeos::CrosLibrary::Get()->GetSystemLibrary()->SetTimezone(timezone); |
993 } | 993 } |
994 } | 994 } |
995 } | 995 } |
996 | 996 |
997 } // namespace browser | 997 } // namespace browser |
OLD | NEW |