| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 // NotificationObserver overrides: | 122 // NotificationObserver overrides: |
| 123 virtual void Observe(int type, | 123 virtual void Observe(int type, |
| 124 const content::NotificationSource& source, | 124 const content::NotificationSource& source, |
| 125 const content::NotificationDetails& details) OVERRIDE; | 125 const content::NotificationDetails& details) OVERRIDE; |
| 126 | 126 |
| 127 // Removes all |email| related wallpaper info and saved wallpapers. | 127 // Removes all |email| related wallpaper info and saved wallpapers. |
| 128 void RemoveUserWallpaperInfo(const std::string& email); | 128 void RemoveUserWallpaperInfo(const std::string& email); |
| 129 | 129 |
| 130 // Resizes |wallpaper| to a resolution which is nearest to |preferred_width| | 130 // Resizes |wallpaper| to a resolution which is nearest to |preferred_width| |
| 131 // and |preferred_height| while maintaining aspect ratio. |
| 132 std::string ResizeWallpaper(const UserImage& wallpaper, |
| 133 ash::WallpaperLayout layout, |
| 134 int preferred_width, |
| 135 int preferred_height); |
| 136 |
| 137 // Resizes |wallpaper| to a resolution which is nearest to |preferred_width| |
| 131 // and |preferred_height| while maintaining aspect ratio. And saves the | 138 // and |preferred_height| while maintaining aspect ratio. And saves the |
| 132 // resized wallpaper to |path|. | 139 // resized wallpaper to |path|. |
| 133 void ResizeAndSaveWallpaper(const UserImage& wallpaper, | 140 void ResizeAndSaveWallpaper(const UserImage& wallpaper, |
| 134 const base::FilePath& path, | 141 const base::FilePath& path, |
| 135 ash::WallpaperLayout layout, | 142 ash::WallpaperLayout layout, |
| 136 int preferred_width, | 143 int preferred_width, |
| 137 int preferred_height); | 144 int preferred_height); |
| 138 | 145 |
| 139 // Starts a one shot timer which calls BatchUpdateWallpaper at next midnight. | 146 // Starts a one shot timer which calls BatchUpdateWallpaper at next midnight. |
| 140 // Cancel any previous timer if any. | 147 // Cancel any previous timer if any. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // cache wallpapers on wallpaper animation finished. The cache operation | 205 // cache wallpapers on wallpaper animation finished. The cache operation |
| 199 // should be only executed once. | 206 // should be only executed once. |
| 200 void CacheUsersWallpapers(); | 207 void CacheUsersWallpapers(); |
| 201 | 208 |
| 202 // Caches |email|'s wallpaper to memory. | 209 // Caches |email|'s wallpaper to memory. |
| 203 void CacheUserWallpaper(const std::string& email); | 210 void CacheUserWallpaper(const std::string& email); |
| 204 | 211 |
| 205 // Clears all obsolete wallpaper prefs from old version wallpaper pickers. | 212 // Clears all obsolete wallpaper prefs from old version wallpaper pickers. |
| 206 void ClearObsoleteWallpaperPrefs(); | 213 void ClearObsoleteWallpaperPrefs(); |
| 207 | 214 |
| 215 // Deletes everything else except |path| in the same directory. |
| 216 void DeleteAllExcept(const base::FilePath& path); |
| 217 |
| 208 // Deletes a list of wallpaper files in |file_list|. | 218 // Deletes a list of wallpaper files in |file_list|. |
| 209 void DeleteWallpaperInList(const std::vector<base::FilePath>& file_list); | 219 void DeleteWallpaperInList(const std::vector<base::FilePath>& file_list); |
| 210 | 220 |
| 211 // Deletes all |email| related custom or converted wallpapers. | 221 // Deletes all |email| related custom or converted wallpapers. |
| 212 void DeleteUserWallpapers(const std::string& email); | 222 void DeleteUserWallpapers(const std::string& email); |
| 213 | 223 |
| 214 // Creates all new custom wallpaper directories for |email| if not exist. | 224 // Creates all new custom wallpaper directories for |email| if not exist. |
| 215 void EnsureCustomWallpaperDirectories(const std::string& email); | 225 void EnsureCustomWallpaperDirectories(const std::string& email); |
| 216 | 226 |
| 217 // Loads custom wallpaper from old places and triggers move all custom | 227 // Loads custom wallpaper from old places and triggers move all custom |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 content::NotificationRegistrar registrar_; | 353 content::NotificationRegistrar registrar_; |
| 344 | 354 |
| 345 base::OneShotTimer<WallpaperManager> timer_; | 355 base::OneShotTimer<WallpaperManager> timer_; |
| 346 | 356 |
| 347 DISALLOW_COPY_AND_ASSIGN(WallpaperManager); | 357 DISALLOW_COPY_AND_ASSIGN(WallpaperManager); |
| 348 }; | 358 }; |
| 349 | 359 |
| 350 } // namespace chromeos | 360 } // namespace chromeos |
| 351 | 361 |
| 352 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ | 362 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WALLPAPER_MANAGER_H_ |
| OLD | NEW |