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 CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/desktop_background/desktop_background_resources.h" | 10 #include "ash/desktop_background/desktop_background_resources.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // For case 2, should_cache_wallpaper_ is used to indicate if we need to | 199 // For case 2, should_cache_wallpaper_ is used to indicate if we need to |
200 // cache wallpapers on wallpaper animation finished. The cache operation | 200 // cache wallpapers on wallpaper animation finished. The cache operation |
201 // should be only executed once. | 201 // should be only executed once. |
202 void CacheAllUsersWallpapers(); | 202 void CacheAllUsersWallpapers(); |
203 | 203 |
204 // Caches |email|'s wallpaper to memory. | 204 // Caches |email|'s wallpaper to memory. |
205 void CacheUserWallpaper(const std::string& email); | 205 void CacheUserWallpaper(const std::string& email); |
206 | 206 |
207 // Generates a 128x80 thumbnail and caches it. | 207 // Generates a 128x80 thumbnail and caches it. |
208 void CacheThumbnail(const std::string& email, | 208 void CacheThumbnail(const std::string& email, |
209 const gfx::ImageSkia& wallpaper); | 209 scoped_ptr<gfx::ImageSkia> wallpaper); |
210 | 210 |
211 // Deletes a list of wallpaper files in |file_list|. | 211 // Deletes a list of wallpaper files in |file_list|. |
212 void DeleteWallpaperInList(const std::vector<FilePath>& file_list); | 212 void DeleteWallpaperInList(const std::vector<FilePath>& file_list); |
213 | 213 |
214 // Deletes all |email| related custom or converted wallpapers. | 214 // Deletes all |email| related custom or converted wallpapers. |
215 void DeleteUserWallpapers(const std::string& email); | 215 void DeleteUserWallpapers(const std::string& email); |
216 | 216 |
217 // Loads |email|'s wallpaper. When |update_wallpaper| is true, sets wallpaper | 217 // Loads |email|'s wallpaper. When |update_wallpaper| is true, sets wallpaper |
218 // to the loaded wallpaper. | 218 // to the loaded wallpaper. |
219 void LoadWallpaper(const std::string& email, | 219 void LoadWallpaper(const std::string& email, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 void OnWallpaperDecoded(const std::string& email, | 258 void OnWallpaperDecoded(const std::string& email, |
259 ash::WallpaperLayout layout, | 259 ash::WallpaperLayout layout, |
260 bool update_wallpaper, | 260 bool update_wallpaper, |
261 const UserImage& wallpaper); | 261 const UserImage& wallpaper); |
262 | 262 |
263 // Saves encoded wallpaper to |path|. This callback is called after encoding | 263 // Saves encoded wallpaper to |path|. This callback is called after encoding |
264 // to PNG completes. | 264 // to PNG completes. |
265 void OnWallpaperEncoded(const FilePath& path, | 265 void OnWallpaperEncoded(const FilePath& path, |
266 scoped_refptr<base::RefCountedBytes> data); | 266 scoped_refptr<base::RefCountedBytes> data); |
267 | 267 |
| 268 // Generates thumbnail of custom wallpaper on FILE thread. If |persistent| is |
| 269 // true, saves original custom image and resized images to disk. |
| 270 void ProcessCustomWallpaper(const std::string& email, |
| 271 bool persistent, |
| 272 const WallpaperInfo& info, |
| 273 base::WeakPtr<WallpaperDelegate> delegate, |
| 274 scoped_ptr<gfx::ImageSkia> image, |
| 275 const UserImage::RawImage& raw_image); |
| 276 |
268 // Record data for User Metrics Analysis. | 277 // Record data for User Metrics Analysis. |
269 void RecordUma(User::WallpaperType type, int index); | 278 void RecordUma(User::WallpaperType type, int index); |
270 | 279 |
271 // Saves original custom wallpaper to |path| (absolute path) on filesystem | 280 // Saves original custom wallpaper to |path| (absolute path) on filesystem |
272 // and starts resizing operation of the custom wallpaper if necessary. | 281 // and starts resizing operation of the custom wallpaper if necessary. |
273 void SaveCustomWallpaper(const std::string& email, | 282 void SaveCustomWallpaper(const std::string& email, |
274 const FilePath& path, | 283 const FilePath& path, |
275 ash::WallpaperLayout layout, | 284 ash::WallpaperLayout layout, |
276 const UserImage& wallpaper); | 285 const UserImage& wallpaper); |
277 | 286 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 content::NotificationRegistrar registrar_; | 343 content::NotificationRegistrar registrar_; |
335 | 344 |
336 base::OneShotTimer<WallpaperManager> timer_; | 345 base::OneShotTimer<WallpaperManager> timer_; |
337 | 346 |
338 DISALLOW_COPY_AND_ASSIGN(WallpaperManager); | 347 DISALLOW_COPY_AND_ASSIGN(WallpaperManager); |
339 }; | 348 }; |
340 | 349 |
341 } // namespace chromeos | 350 } // namespace chromeos |
342 | 351 |
343 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ | 352 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ |
OLD | NEW |