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

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 6307015: Fix a bug where we were showing a wrong language name on the OOBE screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add helpful comments Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 VLOG(1) << "Current locale: " << current_locale; 955 VLOG(1) << "Current locale: " << current_locale;
956 if (current_locale.empty()) { 956 if (current_locale.empty()) {
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 // Set the application locale here so that the language switch
966 // menu shows the language name of |locale|.
967 g_browser_process->SetApplicationLocale(locale);
965 CHECK(!loaded_locale.empty()) << "Locale could not be found for " 968 CHECK(!loaded_locale.empty()) << "Locale could not be found for "
966 << locale; 969 << 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()) 983 if (!locale.empty())
981 chromeos::LanguageSwitchMenu::SwitchLanguage(locale); 984 chromeos::LanguageSwitchMenu::SwitchLanguage(locale);
Nikita (slow) 2011/01/26 12:25:48 SwitchLanguage basically does the same - Reload sh
satorux1 2011/01/26 14:03:06 I think you are right, and we seem to be doing the
982 985
983 // Set initial timezone if specified by customization. 986 // Set initial timezone if specified by customization.
984 const std::string timezone_name = 987 const std::string timezone_name =
985 controller->GetCustomization()->initial_timezone(); 988 controller->GetCustomization()->initial_timezone();
986 VLOG(1) << "Initial time zone: " << timezone_name; 989 VLOG(1) << "Initial time zone: " << timezone_name;
987 // Apply locale customizations only once so preserve whatever locale 990 // Apply locale customizations only once so preserve whatever locale
988 // user has changed to during OOBE. 991 // user has changed to during OOBE.
989 if (!timezone_name.empty()) { 992 if (!timezone_name.empty()) {
990 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( 993 icu::TimeZone* timezone = icu::TimeZone::createTimeZone(
991 icu::UnicodeString::fromUTF8(timezone_name)); 994 icu::UnicodeString::fromUTF8(timezone_name));
992 chromeos::CrosLibrary::Get()->GetSystemLibrary()->SetTimezone(timezone); 995 chromeos::CrosLibrary::Get()->GetSystemLibrary()->SetTimezone(timezone);
993 } 996 }
994 } 997 }
995 } 998 }
996 999
997 } // namespace browser 1000 } // namespace browser
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698