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 #ifndef ASH_WALLPAPER_WALLPAPER_CONTROLLER_H_ | 5 #ifndef ASH_COMMON_WALLPAPER_WALLPAPER_CONTROLLER_H_ |
6 #define ASH_WALLPAPER_WALLPAPER_CONTROLLER_H_ | 6 #define ASH_COMMON_WALLPAPER_WALLPAPER_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/common/shell_observer.h" | 11 #include "ash/common/shell_observer.h" |
12 #include "ash/common/wm_display_observer.h" | 12 #include "ash/common/wm_display_observer.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "components/wallpaper/wallpaper_layout.h" | 15 #include "components/wallpaper/wallpaper_layout.h" |
16 #include "ui/gfx/image/image_skia.h" | 16 #include "ui/gfx/image/image_skia.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class SequencedWorkerPool; | 19 class TaskRunner; |
20 } | 20 } |
21 | 21 |
22 namespace wallpaper { | 22 namespace wallpaper { |
23 class WallpaperResizer; | 23 class WallpaperResizer; |
24 } | 24 } |
25 | 25 |
26 namespace ash { | 26 namespace ash { |
27 | 27 |
28 class WallpaperControllerObserver; | 28 class WallpaperControllerObserver; |
29 | 29 |
30 // Controls the desktop background wallpaper. | 30 // Controls the desktop background wallpaper. |
31 class ASH_EXPORT WallpaperController : public WmDisplayObserver, | 31 class ASH_EXPORT WallpaperController : public WmDisplayObserver, |
32 public ShellObserver { | 32 public ShellObserver { |
33 public: | 33 public: |
34 enum WallpaperMode { WALLPAPER_NONE, WALLPAPER_IMAGE }; | 34 enum WallpaperMode { WALLPAPER_NONE, WALLPAPER_IMAGE }; |
35 | 35 |
36 explicit WallpaperController(base::SequencedWorkerPool* blocking_pool); | 36 explicit WallpaperController(base::TaskRunner* task_runner); |
37 ~WallpaperController() override; | 37 ~WallpaperController() override; |
38 | 38 |
39 // Add/Remove observers. | 39 // Add/Remove observers. |
40 void AddObserver(WallpaperControllerObserver* observer); | 40 void AddObserver(WallpaperControllerObserver* observer); |
41 void RemoveObserver(WallpaperControllerObserver* observer); | 41 void RemoveObserver(WallpaperControllerObserver* observer); |
42 | 42 |
43 // Provides current image on the wallpaper, or empty gfx::ImageSkia if there | 43 // Provides current image on the wallpaper, or empty gfx::ImageSkia if there |
44 // is no image, e.g. wallpaper is none. | 44 // is no image, e.g. wallpaper is none. |
45 gfx::ImageSkia GetWallpaper() const; | 45 gfx::ImageSkia GetWallpaper() const; |
46 | 46 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 base::ObserverList<WallpaperControllerObserver> observers_; | 117 base::ObserverList<WallpaperControllerObserver> observers_; |
118 | 118 |
119 std::unique_ptr<wallpaper::WallpaperResizer> current_wallpaper_; | 119 std::unique_ptr<wallpaper::WallpaperResizer> current_wallpaper_; |
120 | 120 |
121 gfx::Size current_max_display_size_; | 121 gfx::Size current_max_display_size_; |
122 | 122 |
123 base::OneShotTimer timer_; | 123 base::OneShotTimer timer_; |
124 | 124 |
125 int wallpaper_reload_delay_; | 125 int wallpaper_reload_delay_; |
126 | 126 |
127 base::SequencedWorkerPool* blocking_pool_; | 127 base::TaskRunner* task_runner_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(WallpaperController); | 129 DISALLOW_COPY_AND_ASSIGN(WallpaperController); |
130 }; | 130 }; |
131 | 131 |
132 } // namespace ash | 132 } // namespace ash |
133 | 133 |
134 #endif // ASH_WALLPAPER_WALLPAPER_CONTROLLER_H_ | 134 #endif // ASH_COMMON_WALLPAPER_WALLPAPER_CONTROLLER_H_ |
OLD | NEW |