| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base_login_display_host.h" | 5 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); | 257 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); |
| 258 | 258 |
| 259 // Check whether we need to execute OOBE process. | 259 // Check whether we need to execute OOBE process. |
| 260 bool oobe_complete = chromeos::WizardController::IsOobeCompleted(); | 260 bool oobe_complete = chromeos::WizardController::IsOobeCompleted(); |
| 261 bool show_login_screen = | 261 bool show_login_screen = |
| 262 (first_screen_name.empty() && oobe_complete) || | 262 (first_screen_name.empty() && oobe_complete) || |
| 263 first_screen_name == chromeos::WizardController::kLoginScreenName; | 263 first_screen_name == chromeos::WizardController::kLoginScreenName; |
| 264 | 264 |
| 265 chromeos::LoginDisplayHost* display_host; | 265 chromeos::LoginDisplayHost* display_host; |
| 266 #if defined(USE_AURA) |
| 267 // Under Aura we always use the WebUI. |
| 268 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds); |
| 269 #else |
| 266 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWebUILogin)) { | 270 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWebUILogin)) { |
| 267 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds); | 271 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds); |
| 268 } else { | 272 } else { |
| 269 display_host = new chromeos::ViewsLoginDisplayHost(screen_bounds); | 273 display_host = new chromeos::ViewsLoginDisplayHost(screen_bounds); |
| 270 } | 274 } |
| 275 #endif |
| 271 | 276 |
| 272 if (show_login_screen && chromeos::CrosLibrary::Get()->EnsureLoaded()) { | 277 if (show_login_screen && chromeos::CrosLibrary::Get()->EnsureLoaded()) { |
| 273 // R11 > R12 migration fix. See http://crosbug.com/p/4898. | 278 // R11 > R12 migration fix. See http://crosbug.com/p/4898. |
| 274 // If user has manually changed locale during R11 OOBE, locale will be set. | 279 // If user has manually changed locale during R11 OOBE, locale will be set. |
| 275 // On R12 > R12|R13 etc. this fix won't get activated since | 280 // On R12 > R12|R13 etc. this fix won't get activated since |
| 276 // OOBE process has set kApplicationLocale to non-default value. | 281 // OOBE process has set kApplicationLocale to non-default value. |
| 277 PrefService* prefs = g_browser_process->local_state(); | 282 PrefService* prefs = g_browser_process->local_state(); |
| 278 if (!prefs->HasPrefPath(prefs::kApplicationLocale)) { | 283 if (!prefs->HasPrefPath(prefs::kApplicationLocale)) { |
| 279 std::string locale = chromeos::WizardController::GetInitialLocale(); | 284 std::string locale = chromeos::WizardController::GetInitialLocale(); |
| 280 prefs->SetString(prefs::kApplicationLocale, locale); | 285 prefs->SetString(prefs::kApplicationLocale, locale); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // user has changed to during OOBE. | 355 // user has changed to during OOBE. |
| 351 if (!timezone_name.empty()) { | 356 if (!timezone_name.empty()) { |
| 352 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( | 357 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( |
| 353 icu::UnicodeString::fromUTF8(timezone_name)); | 358 icu::UnicodeString::fromUTF8(timezone_name)); |
| 354 CHECK(timezone) << "Timezone could not be set for " << timezone_name; | 359 CHECK(timezone) << "Timezone could not be set for " << timezone_name; |
| 355 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); | 360 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); |
| 356 } | 361 } |
| 357 } | 362 } |
| 358 | 363 |
| 359 } // namespace browser | 364 } // namespace browser |
| OLD | NEW |