Index: chrome/browser/chromeos/customization_document.h |
diff --git a/chrome/browser/chromeos/customization_document.h b/chrome/browser/chromeos/customization_document.h |
index a6241cc1a89761f36366ab700bdafd73dc652a22..4cf81241a7916f97ff94ed1a8101ee6c5fca013f 100644 |
--- a/chrome/browser/chromeos/customization_document.h |
+++ b/chrome/browser/chromeos/customization_document.h |
@@ -44,6 +44,7 @@ void Test__InitStartupCustomizationDocument(const std::string& manifest); |
namespace chromeos { |
class ServicesCustomizationExternalLoader; |
+class CustomizationWallpaperDownloader; |
namespace system { |
class StatisticsProvider; |
@@ -170,8 +171,14 @@ class ServicesCustomizationDocument : public CustomizationDocument, |
// Cache of OEM default apps stored in profile preferences. |
extensions::ExternalLoader* CreateExternalLoader(Profile* profile); |
+ // This is also used by Wallpaper manager to set customized wallpaper path |
+ // to global default before first wallpaper was shown. |
+ static base::FilePath GetCustomizedWallpaperCacheDir(); |
+ static base::FilePath GetCustomizedWallpaperDownloadedFileName(); |
+ |
private: |
friend struct DefaultSingletonTraits<ServicesCustomizationDocument>; |
+ friend class CustomizationWallpaperDownloader; |
typedef std::vector<base::WeakPtr<ServicesCustomizationExternalLoader> > |
ExternalLoaders; |
@@ -212,6 +219,24 @@ class ServicesCustomizationDocument : public CustomizationDocument, |
// Update cached manifest for |profile|. |
void UpdateCachedManifest(Profile* profile); |
+ // Set Shell default wallpaper to customized. |
+ static void SetDefaultWallpaperPath(const GURL& wallpaper_url); |
+ |
+ // This is called by CustomizationWallpaperDownloader to destroy self. |
+ static void DestroyWallpaperDownloader(); |
+ |
+ // Start download of wallpaper image if need. |
+ void StartOEMWallpaperDownload(const GURL& wallpaper_url); |
+ |
+ // Check downloaded wallpaper and start download if needed. |
+ void CheckAndApplyWallpaper(); |
+ |
+ // Intermediate function to pass the result of PathExists to ApplyWallpaper. |
+ void OnCheckedWallpaperCacheExists(scoped_ptr<bool>); |
+ |
+ // Called after downloaded wallpaper has been checked. |
+ void ApplyWallpaper(bool default_wallpaper_file_exists); |
+ |
// Services customization manifest URL. |
GURL url_; |
@@ -230,6 +255,11 @@ class ServicesCustomizationDocument : public CustomizationDocument, |
// Known external loaders. |
ExternalLoaders external_loaders_; |
+ scoped_ptr<CustomizationWallpaperDownloader> wallpaper_downloader_; |
+ |
+ // Tests can destroy singletons. |
+ base::WeakPtrFactory<ServicesCustomizationDocument> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument); |
}; |