| 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/chromeos/login/base_login_display_host.h" | 5 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/workspace_controller.h" // temporary until w2 is the default. | 10 #include "ash/wm/workspace_controller.h" // temporary until w2 is the default. |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 kEnableBrowserWindowsOpacityAnimation; | 341 kEnableBrowserWindowsOpacityAnimation; |
| 342 | 342 |
| 343 // Background animation. | 343 // Background animation. |
| 344 if (do_background_animation) { | 344 if (do_background_animation) { |
| 345 ui::Layer* background_layer = | 345 ui::Layer* background_layer = |
| 346 ash::Shell::GetContainer( | 346 ash::Shell::GetContainer( |
| 347 ash::Shell::GetPrimaryRootWindow(), | 347 ash::Shell::GetPrimaryRootWindow(), |
| 348 ash::internal::kShellWindowId_DesktopBackgroundContainer)-> | 348 ash::internal::kShellWindowId_DesktopBackgroundContainer)-> |
| 349 layer(); | 349 layer(); |
| 350 | 350 |
| 351 ui::Transform background_transform; | 351 gfx::Transform background_transform; |
| 352 background_transform.SetScale(kBackgroundScale, kBackgroundScale); | 352 background_transform.SetScale(kBackgroundScale, kBackgroundScale); |
| 353 background_transform.SetTranslateX(kBackgroundTranslate); | 353 background_transform.SetTranslateX(kBackgroundTranslate); |
| 354 background_transform.SetTranslateY(kBackgroundTranslate); | 354 background_transform.SetTranslateY(kBackgroundTranslate); |
| 355 background_layer->SetTransform(background_transform); | 355 background_layer->SetTransform(background_transform); |
| 356 | 356 |
| 357 // Pause | 357 // Pause |
| 358 ui::LayerAnimationElement::AnimatableProperties background_pause_properties; | 358 ui::LayerAnimationElement::AnimatableProperties background_pause_properties; |
| 359 background_pause_properties.insert(ui::LayerAnimationElement::TRANSFORM); | 359 background_pause_properties.insert(ui::LayerAnimationElement::TRANSFORM); |
| 360 background_layer->GetAnimator()->StartAnimation( | 360 background_layer->GetAnimator()->StartAnimation( |
| 361 new ui::LayerAnimationSequence( | 361 new ui::LayerAnimationSequence( |
| 362 ui::LayerAnimationElement::CreatePauseElement( | 362 ui::LayerAnimationElement::CreatePauseElement( |
| 363 background_pause_properties, | 363 background_pause_properties, |
| 364 base::TimeDelta::FromMilliseconds( | 364 base::TimeDelta::FromMilliseconds( |
| 365 kBackgroundTransitionPauseMs)))); | 365 kBackgroundTransitionPauseMs)))); |
| 366 | 366 |
| 367 ui::ScopedLayerAnimationSettings settings(background_layer->GetAnimator()); | 367 ui::ScopedLayerAnimationSettings settings(background_layer->GetAnimator()); |
| 368 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); | 368 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); |
| 369 settings.SetTransitionDuration( | 369 settings.SetTransitionDuration( |
| 370 base::TimeDelta::FromMilliseconds(kBackgroundTransitionDurationMs)); | 370 base::TimeDelta::FromMilliseconds(kBackgroundTransitionDurationMs)); |
| 371 settings.SetTweenType(ui::Tween::EASE_OUT); | 371 settings.SetTweenType(ui::Tween::EASE_OUT); |
| 372 background_layer->SetTransform(ui::Transform()); | 372 background_layer->SetTransform(gfx::Transform()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 // Browser windows layer opacity and transform animation. | 375 // Browser windows layer opacity and transform animation. |
| 376 if (ash::internal::WorkspaceController::IsWorkspace2Enabled()) { | 376 if (ash::internal::WorkspaceController::IsWorkspace2Enabled()) { |
| 377 ash::Shell::GetInstance()->DoInitialWorkspaceAnimation(); | 377 ash::Shell::GetInstance()->DoInitialWorkspaceAnimation(); |
| 378 } else if (do_browser_transform_animation || do_browser_opacity_animation) { | 378 } else if (do_browser_transform_animation || do_browser_opacity_animation) { |
| 379 ui::Layer* default_container_layer = | 379 ui::Layer* default_container_layer = |
| 380 ash::Shell::GetContainer( | 380 ash::Shell::GetContainer( |
| 381 ash::Shell::GetPrimaryRootWindow(), | 381 ash::Shell::GetPrimaryRootWindow(), |
| 382 ash::internal::kShellWindowId_DefaultContainer)->layer(); | 382 ash::internal::kShellWindowId_DefaultContainer)->layer(); |
| 383 | 383 |
| 384 ui::LayerAnimationElement::AnimatableProperties browser_pause_properties; | 384 ui::LayerAnimationElement::AnimatableProperties browser_pause_properties; |
| 385 | 385 |
| 386 // Set the initial opacity and transform. | 386 // Set the initial opacity and transform. |
| 387 if (do_browser_transform_animation) { | 387 if (do_browser_transform_animation) { |
| 388 ui::Transform browser_transform; | 388 gfx::Transform browser_transform; |
| 389 browser_transform.SetScale(kBrowserScale, kBrowserScale); | 389 browser_transform.SetScale(kBrowserScale, kBrowserScale); |
| 390 browser_transform.SetTranslateX(kBrowserTranslate); | 390 browser_transform.SetTranslateX(kBrowserTranslate); |
| 391 browser_transform.SetTranslateY(kBrowserTranslate); | 391 browser_transform.SetTranslateY(kBrowserTranslate); |
| 392 default_container_layer->SetTransform(browser_transform); | 392 default_container_layer->SetTransform(browser_transform); |
| 393 browser_pause_properties.insert(ui::LayerAnimationElement::TRANSFORM); | 393 browser_pause_properties.insert(ui::LayerAnimationElement::TRANSFORM); |
| 394 } | 394 } |
| 395 | 395 |
| 396 if (do_browser_opacity_animation) { | 396 if (do_browser_opacity_animation) { |
| 397 default_container_layer->SetOpacity(0); | 397 default_container_layer->SetOpacity(0); |
| 398 browser_pause_properties.insert(ui::LayerAnimationElement::OPACITY); | 398 browser_pause_properties.insert(ui::LayerAnimationElement::OPACITY); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 412 settings.SetTransitionDuration( | 412 settings.SetTransitionDuration( |
| 413 base::TimeDelta::FromMilliseconds(kBrowserTransitionDurationMs)); | 413 base::TimeDelta::FromMilliseconds(kBrowserTransitionDurationMs)); |
| 414 | 414 |
| 415 if (do_browser_opacity_animation) { | 415 if (do_browser_opacity_animation) { |
| 416 // Should interpolate linearly. | 416 // Should interpolate linearly. |
| 417 default_container_layer->SetOpacity(1); | 417 default_container_layer->SetOpacity(1); |
| 418 } | 418 } |
| 419 | 419 |
| 420 if (do_browser_transform_animation) { | 420 if (do_browser_transform_animation) { |
| 421 settings.SetTweenType(ui::Tween::EASE_OUT); | 421 settings.SetTweenType(ui::Tween::EASE_OUT); |
| 422 default_container_layer->SetTransform(ui::Transform()); | 422 default_container_layer->SetTransform(gfx::Transform()); |
| 423 } | 423 } |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 | 426 |
| 427 void BaseLoginDisplayHost::OnOwnershipStatusCheckDone( | 427 void BaseLoginDisplayHost::OnOwnershipStatusCheckDone( |
| 428 DeviceSettingsService::OwnershipStatus status, | 428 DeviceSettingsService::OwnershipStatus status, |
| 429 bool current_user_is_owner) { | 429 bool current_user_is_owner) { |
| 430 if (status != DeviceSettingsService::OWNERSHIP_NONE) { | 430 if (status != DeviceSettingsService::OWNERSHIP_NONE) { |
| 431 // The device is already owned. No need for auto-enrollment checks. | 431 // The device is already owned. No need for auto-enrollment checks. |
| 432 VLOG(1) << "CheckForAutoEnrollment: device already owned"; | 432 VLOG(1) << "CheckForAutoEnrollment: device already owned"; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 VLOG(1) << "Initial time zone: " << timezone_name; | 592 VLOG(1) << "Initial time zone: " << timezone_name; |
| 593 // Apply locale customizations only once to preserve whatever locale | 593 // Apply locale customizations only once to preserve whatever locale |
| 594 // user has changed to during OOBE. | 594 // user has changed to during OOBE. |
| 595 if (!timezone_name.empty()) { | 595 if (!timezone_name.empty()) { |
| 596 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 596 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 597 UTF8ToUTF16(timezone_name)); | 597 UTF8ToUTF16(timezone_name)); |
| 598 } | 598 } |
| 599 } | 599 } |
| 600 | 600 |
| 601 } // namespace chromeos | 601 } // namespace chromeos |
| OLD | NEW |