| 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 "ash/desktop_background/desktop_background_controller.h" | 5 #include "ash/desktop_background/desktop_background_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <cstdlib> | 8 #include <cstdlib> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // Steps a widget's layer animation until it is completed. Animations must be | 79 // Steps a widget's layer animation until it is completed. Animations must be |
| 80 // enabled. | 80 // enabled. |
| 81 void RunAnimationForWidget(views::Widget* widget) { | 81 void RunAnimationForWidget(views::Widget* widget) { |
| 82 // Animations must be enabled for stepping to work. | 82 // Animations must be enabled for stepping to work. |
| 83 ASSERT_NE(ui::ScopedAnimationDurationScaleMode::duration_scale_mode(), | 83 ASSERT_NE(ui::ScopedAnimationDurationScaleMode::duration_scale_mode(), |
| 84 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); | 84 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); |
| 85 | 85 |
| 86 ui::Layer* layer = widget->GetNativeView()->layer(); | 86 ui::Layer* layer = widget->GetNativeView()->layer(); |
| 87 ui::LayerAnimatorTestController controller(layer->GetAnimator()); | 87 ui::LayerAnimatorTestController controller(layer->GetAnimator()); |
| 88 ui::AnimationContainerElement* element = layer->GetAnimator(); | 88 gfx::AnimationContainerElement* element = layer->GetAnimator(); |
| 89 // Multiple steps are required to complete complex animations. | 89 // Multiple steps are required to complete complex animations. |
| 90 // TODO(vollick): This should not be necessary. crbug.com/154017 | 90 // TODO(vollick): This should not be necessary. crbug.com/154017 |
| 91 while (controller.animator()->is_animating()) { | 91 while (controller.animator()->is_animating()) { |
| 92 controller.StartThreadedAnimationsIfNeeded(); | 92 controller.StartThreadedAnimationsIfNeeded(); |
| 93 base::TimeTicks step_time = controller.animator()->last_step_time(); | 93 base::TimeTicks step_time = controller.animator()->last_step_time(); |
| 94 element->Step(step_time + base::TimeDelta::FromMilliseconds(1000)); | 94 element->Step(step_time + base::TimeDelta::FromMilliseconds(1000)); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace | 98 } // namespace |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 Shell::GetInstance()->display_manager()); | 519 Shell::GetInstance()->display_manager()); |
| 520 display_manager_test_api.UpdateDisplay("1600x1200"); | 520 display_manager_test_api.UpdateDisplay("1600x1200"); |
| 521 ASSERT_TRUE(controller_->SetDefaultWallpaper(true)); | 521 ASSERT_TRUE(controller_->SetDefaultWallpaper(true)); |
| 522 observer.WaitForWallpaperDataChanged(); | 522 observer.WaitForWallpaperDataChanged(); |
| 523 EXPECT_TRUE(ImageIsNearColor(controller_->GetWallpaper(), | 523 EXPECT_TRUE(ImageIsNearColor(controller_->GetWallpaper(), |
| 524 kLargeGuestWallpaperColor)); | 524 kLargeGuestWallpaperColor)); |
| 525 } | 525 } |
| 526 | 526 |
| 527 } // namespace internal | 527 } // namespace internal |
| 528 } // namespace ash | 528 } // namespace ash |
| OLD | NEW |