Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4605)

Unified Diff: chrome/browser/chromeos/customization_document.h

Issue 208273005: If customization includes default wallpaper, download and apply it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after-review. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/test_user_wallpaper_delegate.cc ('k') | chrome/browser/chromeos/customization_document.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/customization_document.h
diff --git a/chrome/browser/chromeos/customization_document.h b/chrome/browser/chromeos/customization_document.h
index 95885fc9439d3f3996a4f40ac9bca19483d77fc1..f1a2528a99c6da3a107a53e817749619a14a8757 100644
--- a/chrome/browser/chromeos/customization_document.h
+++ b/chrome/browser/chromeos/customization_document.h
@@ -43,6 +43,7 @@ void Test__InitStartupCustomizationDocument(const std::string& manifest);
namespace chromeos {
class ServicesCustomizationExternalLoader;
+class CustomizationWallpaperDownloader;
namespace system {
class StatisticsProvider;
@@ -177,6 +178,18 @@ class ServicesCustomizationDocument : public CustomizationDocument,
network_delay_ = base::TimeDelta();
}
+ // This is also used by WallpaperManager to set customized wallpaper path
+ // to global default before first wallpaper is shown.
+ static base::FilePath GetCustomizedWallpaperCacheDir();
+ static base::FilePath GetCustomizedWallpaperDownloadedFileName();
+
+ // Set Shell default wallpaper to customized.
+ // Called by CustomizationWallpaperDownloader.
+ static void OnCustomizedWallpaperDownloaded(const GURL& wallpaper_url);
+
+ // This is called by CustomizationWallpaperDownloader to destroy self.
+ void DestroyWallpaperDownloader();
+
private:
friend struct DefaultSingletonTraits<ServicesCustomizationDocument>;
@@ -235,6 +248,18 @@ class ServicesCustomizationDocument : public CustomizationDocument,
const std::string& locale,
const base::DictionaryValue& root) const;
+ // 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_;
@@ -256,6 +281,8 @@ class ServicesCustomizationDocument : public CustomizationDocument,
// Weak factory for callbacks.
base::WeakPtrFactory<ServicesCustomizationDocument> weak_ptr_factory_;
+ scoped_ptr<CustomizationWallpaperDownloader> wallpaper_downloader_;
+
DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument);
};
« no previous file with comments | « ash/test/test_user_wallpaper_delegate.cc ('k') | chrome/browser/chromeos/customization_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698