| 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/common/wallpaper/wallpaper_controller.h" | 5 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <cstdlib> | 8 #include <cstdlib> |
| 9 | 9 |
| 10 #include "ash/common/wallpaper/wallpaper_view.h" | 10 #include "ash/common/wallpaper/wallpaper_view.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void SetUp() override { | 111 void SetUp() override { |
| 112 test::AshTestBase::SetUp(); | 112 test::AshTestBase::SetUp(); |
| 113 // Ash shell initialization creates wallpaper. Reset it so we can manually | 113 // Ash shell initialization creates wallpaper. Reset it so we can manually |
| 114 // control wallpaper creation and animation in our tests. | 114 // control wallpaper creation and animation in our tests. |
| 115 RootWindowController* root_window_controller = | 115 RootWindowController* root_window_controller = |
| 116 WmShell::Get()->GetPrimaryRootWindow()->GetRootWindowController(); | 116 WmShell::Get()->GetPrimaryRootWindow()->GetRootWindowController(); |
| 117 root_window_controller->SetWallpaperWidgetController(nullptr); | 117 root_window_controller->SetWallpaperWidgetController(nullptr); |
| 118 root_window_controller->SetAnimatingWallpaperWidgetController(nullptr); | 118 root_window_controller->SetAnimatingWallpaperWidgetController(nullptr); |
| 119 controller_ = Shell::GetInstance()->wallpaper_controller(); | 119 controller_ = Shell::GetInstance()->wallpaper_controller(); |
| 120 wallpaper_delegate_ = static_cast<test::TestWallpaperDelegate*>( | 120 wallpaper_delegate_ = static_cast<test::TestWallpaperDelegate*>( |
| 121 WmShell::Get()->wallpaper_delegate()); | 121 Shell::Get()->wallpaper_delegate()); |
| 122 controller_->set_wallpaper_reload_delay_for_test(0); | 122 controller_->set_wallpaper_reload_delay_for_test(0); |
| 123 } | 123 } |
| 124 | 124 |
| 125 WallpaperView* wallpaper_view() { | 125 WallpaperView* wallpaper_view() { |
| 126 WallpaperWidgetController* controller = | 126 WallpaperWidgetController* controller = |
| 127 WmShell::Get() | 127 WmShell::Get() |
| 128 ->GetPrimaryRootWindow() | 128 ->GetPrimaryRootWindow() |
| 129 ->GetRootWindowController() | 129 ->GetRootWindowController() |
| 130 ->animating_wallpaper_widget_controller() | 130 ->animating_wallpaper_widget_controller() |
| 131 ->GetController(false); | 131 ->GetController(false); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 { | 469 { |
| 470 SCOPED_TRACE(base::StringPrintf("1200x600/u@1.5 low resolution")); | 470 SCOPED_TRACE(base::StringPrintf("1200x600/u@1.5 low resolution")); |
| 471 controller_->SetWallpaperImage(image_low_res, WALLPAPER_LAYOUT_CENTER); | 471 controller_->SetWallpaperImage(image_low_res, WALLPAPER_LAYOUT_CENTER); |
| 472 WallpaperFitToNativeResolution( | 472 WallpaperFitToNativeResolution( |
| 473 wallpaper_view(), low_dsf, low_resolution.width(), | 473 wallpaper_view(), low_dsf, low_resolution.width(), |
| 474 low_resolution.height(), kCustomWallpaperColor); | 474 low_resolution.height(), kCustomWallpaperColor); |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 | 477 |
| 478 } // namespace ash | 478 } // namespace ash |
| OLD | NEW |