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 | |
84 // Loads default wallpaper at |index| asynchronously and sets to current | 79 // Loads default wallpaper at |index| asynchronously and sets to current |
85 // wallpaper after loaded. When |force_reload| is true, reload wallpaper | 80 // wallpaper after loaded. When |force_reload| is true, reload wallpaper |
86 // for all root windows even if |index| is the same as current wallpaper. It | 81 // for all root windows even if |index| is the same as current wallpaper. It |
87 // must be true when a different resolution of current wallpaper is needed. | 82 // must be true when a different resolution of current wallpaper is needed. |
88 void SetDefaultWallpaper(int index, bool force_reload); | 83 void SetDefaultWallpaper(int index, bool force_reload); |
89 | 84 |
90 // Sets the user selected custom wallpaper. Called when user selected a file | 85 // Sets the user selected custom wallpaper. Called when user selected a file |
91 // from file system or changed the layout of wallpaper. | 86 // from file system or changed the layout of wallpaper. |
92 void SetCustomWallpaper(const gfx::ImageSkia& wallpaper, | 87 void SetCustomWallpaper(const gfx::ImageSkia& wallpaper, |
93 WallpaperLayout layout); | 88 WallpaperLayout layout); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // all root windows. | 138 // all root windows. |
144 void InstallComponentForAllWindows(); | 139 void InstallComponentForAllWindows(); |
145 | 140 |
146 // Moves all descktop components from one container to other across all root | 141 // Moves all descktop components from one container to other across all root |
147 // windows. | 142 // windows. |
148 void ReparentBackgroundWidgets(int src_container, int dst_container); | 143 void ReparentBackgroundWidgets(int src_container, int dst_container); |
149 | 144 |
150 // Returns id for background container for unlocked and locked states. | 145 // Returns id for background container for unlocked and locked states. |
151 int GetBackgroundContainerId(bool locked); | 146 int GetBackgroundContainerId(bool locked); |
152 | 147 |
153 // Returns the appropriate wallpaper resolution for all root windows. | |
154 WallpaperResolution GetAppropriateResolution(); | |
155 | |
156 // Can change at runtime. | 148 // Can change at runtime. |
157 bool locked_; | 149 bool locked_; |
158 | 150 |
159 BackgroundMode desktop_background_mode_; | 151 BackgroundMode desktop_background_mode_; |
160 | 152 |
161 SkColor background_color_; | 153 SkColor background_color_; |
162 | 154 |
163 // The current wallpaper. | 155 // The current wallpaper. |
164 scoped_ptr<WallpaperData> current_wallpaper_; | 156 scoped_ptr<WallpaperData> current_wallpaper_; |
165 | 157 |
166 scoped_refptr<WallpaperOperation> wallpaper_op_; | 158 scoped_refptr<WallpaperOperation> wallpaper_op_; |
167 | 159 |
168 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; | 160 base::WeakPtrFactory<DesktopBackgroundController> weak_ptr_factory_; |
169 | 161 |
170 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); | 162 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundController); |
171 }; | 163 }; |
172 | 164 |
173 } // namespace ash | 165 } // namespace ash |
174 | 166 |
175 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ | 167 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_CONTROLLER_H_ |
OLD | NEW |