| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 content::NotificationService::AllSources()); | 322 content::NotificationService::AllSources()); |
| 323 | 323 |
| 324 DCHECK(default_host_ == NULL); | 324 DCHECK(default_host_ == NULL); |
| 325 default_host_ = this; | 325 default_host_ = this; |
| 326 | 326 |
| 327 // Make sure chrome won't exit while we are at login/oobe screen. | 327 // Make sure chrome won't exit while we are at login/oobe screen. |
| 328 chrome::IncrementKeepAliveCount(); | 328 chrome::IncrementKeepAliveCount(); |
| 329 | 329 |
| 330 bool is_registered = StartupUtils::IsDeviceRegistered(); | 330 bool is_registered = StartupUtils::IsDeviceRegistered(); |
| 331 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); | 331 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
| 332 bool disable_boot_animation = CommandLine::ForCurrentProcess()->HasSwitch( | 332 bool disable_boot_animation = |
| 333 switches::kDisableBootAnimation); | 333 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 334 switches::kDisableBootAnimation); |
| 334 | 335 |
| 335 waiting_for_wallpaper_load_ = !zero_delay_enabled && | 336 waiting_for_wallpaper_load_ = !zero_delay_enabled && |
| 336 (!is_registered || !disable_boot_animation); | 337 (!is_registered || !disable_boot_animation); |
| 337 | 338 |
| 338 #if defined(USE_ATHENA) | 339 #if defined(USE_ATHENA) |
| 339 // TODO(dpolukhin): remove #ifdef when Athena supports wallpaper manager. | 340 // TODO(dpolukhin): remove #ifdef when Athena supports wallpaper manager. |
| 340 // crbug.com/408734 | 341 // crbug.com/408734 |
| 341 waiting_for_wallpaper_load_ = false; | 342 waiting_for_wallpaper_load_ = false; |
| 342 #endif | 343 #endif |
| 343 | 344 |
| 344 // For slower hardware we have boot animation disabled so | 345 // For slower hardware we have boot animation disabled so |
| 345 // we'll be initializing WebUI hidden, waiting for user pods to load and then | 346 // we'll be initializing WebUI hidden, waiting for user pods to load and then |
| 346 // show WebUI at once. | 347 // show WebUI at once. |
| 347 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; | 348 waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; |
| 348 | 349 |
| 349 initialize_webui_hidden_ = | 350 initialize_webui_hidden_ = |
| 350 kHiddenWebUIInitializationDefault && !zero_delay_enabled; | 351 kHiddenWebUIInitializationDefault && !zero_delay_enabled; |
| 351 | 352 |
| 352 // Check if WebUI init type is overriden. | 353 // Check if WebUI init type is overriden. |
| 353 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshWebUIInit)) { | 354 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 355 switches::kAshWebUIInit)) { |
| 354 const std::string override_type = | 356 const std::string override_type = |
| 355 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 357 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 356 switches::kAshWebUIInit); | 358 switches::kAshWebUIInit); |
| 357 if (override_type == kWebUIInitParallel) | 359 if (override_type == kWebUIInitParallel) |
| 358 initialize_webui_hidden_ = true; | 360 initialize_webui_hidden_ = true; |
| 359 else if (override_type == kWebUIInitPostpone) | 361 else if (override_type == kWebUIInitPostpone) |
| 360 initialize_webui_hidden_ = false; | 362 initialize_webui_hidden_ = false; |
| 361 } | 363 } |
| 362 | 364 |
| 363 // Always postpone WebUI initialization on first boot, otherwise we miss | 365 // Always postpone WebUI initialization on first boot, otherwise we miss |
| 364 // initial animation. | 366 // initial animation. |
| 365 if (!StartupUtils::IsOobeCompleted()) | 367 if (!StartupUtils::IsOobeCompleted()) |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 #if !defined(USE_ATHENA) | 942 #if !defined(USE_ATHENA) |
| 941 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 943 if (ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 942 ash::kShellWindowId_DesktopBackgroundContainer) | 944 ash::kShellWindowId_DesktopBackgroundContainer) |
| 943 ->children() | 945 ->children() |
| 944 .empty()) { | 946 .empty()) { |
| 945 // If there is no background window, don't perform any animation on the | 947 // If there is no background window, don't perform any animation on the |
| 946 // default and background layer because there is nothing behind it. | 948 // default and background layer because there is nothing behind it. |
| 947 return; | 949 return; |
| 948 } | 950 } |
| 949 | 951 |
| 950 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 952 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 951 switches::kDisableLoginAnimations)) | 953 switches::kDisableLoginAnimations)) |
| 952 ash::Shell::GetInstance()->DoInitialWorkspaceAnimation(); | 954 ash::Shell::GetInstance()->DoInitialWorkspaceAnimation(); |
| 953 #endif | 955 #endif |
| 954 } | 956 } |
| 955 | 957 |
| 956 void LoginDisplayHostImpl::ScheduleFadeOutAnimation() { | 958 void LoginDisplayHostImpl::ScheduleFadeOutAnimation() { |
| 957 ui::Layer* layer = login_window_->GetLayer(); | 959 ui::Layer* layer = login_window_->GetLayer(); |
| 958 ui::ScopedLayerAnimationSettings animation(layer->GetAnimator()); | 960 ui::ScopedLayerAnimationSettings animation(layer->GetAnimator()); |
| 959 animation.AddObserver(new AnimationObserver( | 961 animation.AddObserver(new AnimationObserver( |
| 960 base::Bind(&LoginDisplayHostImpl::ShutdownDisplayHost, | 962 base::Bind(&LoginDisplayHostImpl::ShutdownDisplayHost, |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 | 1174 |
| 1173 PrefService* prefs = g_browser_process->local_state(); | 1175 PrefService* prefs = g_browser_process->local_state(); |
| 1174 // Apply owner preferences for tap-to-click and mouse buttons swap for | 1176 // Apply owner preferences for tap-to-click and mouse buttons swap for |
| 1175 // login screen. | 1177 // login screen. |
| 1176 system::InputDeviceSettings::Get()->SetPrimaryButtonRight( | 1178 system::InputDeviceSettings::Get()->SetPrimaryButtonRight( |
| 1177 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); | 1179 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); |
| 1178 system::InputDeviceSettings::Get()->SetTapToClick( | 1180 system::InputDeviceSettings::Get()->SetTapToClick( |
| 1179 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); | 1181 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); |
| 1180 } | 1182 } |
| 1181 system::InputDeviceSettings::Get()->SetNaturalScroll( | 1183 system::InputDeviceSettings::Get()->SetNaturalScroll( |
| 1182 CommandLine::ForCurrentProcess()->HasSwitch( | 1184 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1183 switches::kNaturalScrollDefault)); | 1185 switches::kNaturalScrollDefault)); |
| 1184 #endif | 1186 #endif |
| 1185 | 1187 |
| 1186 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); | 1188 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); |
| 1187 | 1189 |
| 1188 g_browser_process->platform_part()->SessionManager()->SetSessionState( | 1190 g_browser_process->platform_part()->SessionManager()->SetSessionState( |
| 1189 StartupUtils::IsOobeCompleted() | 1191 StartupUtils::IsOobeCompleted() |
| 1190 ? session_manager::SESSION_STATE_LOGIN_PRIMARY | 1192 ? session_manager::SESSION_STATE_LOGIN_PRIMARY |
| 1191 : session_manager::SESSION_STATE_OOBE); | 1193 : session_manager::SESSION_STATE_OOBE); |
| 1192 | 1194 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 | 1275 |
| 1274 locale_util::SwitchLanguageCallback callback( | 1276 locale_util::SwitchLanguageCallback callback( |
| 1275 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); | 1277 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); |
| 1276 | 1278 |
| 1277 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1279 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1278 locale_util::SwitchLanguage( | 1280 locale_util::SwitchLanguage( |
| 1279 locale, true, true /* login_layouts_only */, callback); | 1281 locale, true, true /* login_layouts_only */, callback); |
| 1280 } | 1282 } |
| 1281 | 1283 |
| 1282 } // namespace chromeos | 1284 } // namespace chromeos |
| OLD | NEW |