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_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 5 #ifndef ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/desktop_background/desktop_background_resources.h" | 9 #include "ash/desktop_background/desktop_background_resources.h" |
10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 WallpaperLayout GetWallpaperLayout() const; | 70 WallpaperLayout GetWallpaperLayout() const; |
71 | 71 |
72 // Provides current image on the background, or empty SkBitmap if there is | 72 // Provides current image on the background, or empty SkBitmap if there is |
73 // no image, e.g. background is solid color. | 73 // no image, e.g. background is solid color. |
74 SkBitmap GetCurrentWallpaperImage(); | 74 SkBitmap GetCurrentWallpaperImage(); |
75 | 75 |
76 // Initialize root window's background. | 76 // Initialize root window's background. |
77 void OnRootWindowAdded(aura::RootWindow* root_window); | 77 void OnRootWindowAdded(aura::RootWindow* root_window); |
78 | 78 |
| 79 // Loads default wallpaper at |index| asynchronously but does not set the |
| 80 // loaded image to current wallpaper. Resource bundle will cache the loaded |
| 81 // image. |
| 82 void CacheDefaultWallpaper(int index); |
| 83 |
79 // Loads default wallpaper at |index| asynchronously and sets to current | 84 // Loads default wallpaper at |index| asynchronously and sets to current |
80 // wallpaper after loaded. When |force_reload| is true, reload wallpaper | 85 // wallpaper after loaded. When |force_reload| is true, reload wallpaper |
81 // for all root windows even if |index| is the same as current wallpaper. It | 86 // for all root windows even if |index| is the same as current wallpaper. It |
82 // must be true when a different resolution of current wallpaper is needed. | 87 // must be true when a different resolution of current wallpaper is needed. |
83 void SetDefaultWallpaper(int index, bool force_reload); | 88 void SetDefaultWallpaper(int index, bool force_reload); |
84 | 89 |
85 // Sets the user selected custom wallpaper. Called when user selected a file | 90 // Sets the user selected custom wallpaper. Called when user selected a file |
86 // from file system or changed the layout of wallpaper. | 91 // from file system or changed the layout of wallpaper. |
87 void SetCustomWallpaper(const gfx::ImageSkia& wallpaper, | 92 void SetCustomWallpaper(const gfx::ImageSkia& wallpaper, |
88 WallpaperLayout layout); | 93 WallpaperLayout layout); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // all root windows. | 143 // all root windows. |
139 void InstallComponentForAllWindows(); | 144 void InstallComponentForAllWindows(); |
140 | 145 |
141 // Moves all descktop components from one container to other across all root | 146 // Moves all descktop components from one container to other across all root |
142 // windows. | 147 // windows. |
143 void ReparentBackgroundWidgets(int src_container, int dst_container); | 148 void ReparentBackgroundWidgets(int src_container, int dst_container); |
144 | 149 |
145 // Returns id for background container for unlocked and locked states. | 150 // Returns id for background container for unlocked and locked states. |
146 int GetBackgroundContainerId(bool locked); | 151 int GetBackgroundContainerId(bool locked); |
147 | 152 |
| 153 // Returns the appropriate wallpaper resolution for all root windows. |
| 154 WallpaperResolution GetAppropriateResolution(); |
| 155 |
148 // Can change at runtime. | 156 // Can change at runtime. |
149 bool locked_; | 157 bool locked_; |
150 | 158 |
151 BackgroundMode desktop_background_mode_; | 159 BackgroundMode desktop_background_mode_; |
152 | 160 |
153 SkColor background_color_; | 161 SkColor background_color_; |
154 | 162 |
155 // The current wallpaper. | 163 // The current wallpaper. |
156 scoped_ptr<WallpaperData> current_wallpaper_; | 164 scoped_ptr<WallpaperData> current_wallpaper_; |
157 | 165 |
158 scoped_refptr<WallpaperOperation> wallpaper_op_; | 166 scoped_refptr<WallpaperOperation> wallpaper_op_; |
159 | 167 |
160 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; | 168 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; |
161 | 169 |
162 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); | 170 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); |
163 }; | 171 }; |
164 | 172 |
165 } // namespace ash | 173 } // namespace ash |
166 | 174 |
167 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 175 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
OLD | NEW |