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

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

Issue 236013002: Apply default wallpaper from customization manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: After-review. Created 6 years, 8 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
Index: chrome/browser/chromeos/customization_document.h
diff --git a/chrome/browser/chromeos/customization_document.h b/chrome/browser/chromeos/customization_document.h
index 1c0ea8fcea6290bae9a6409e71e68219474bb138..5077d194f6a00e72c7a53750b3e637c905517c77 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;
Daniel Erat 2014/04/14 15:26:15 nit: alphabetize these
Alexander Alekseev 2014/04/15 01:57:16 Done.
namespace system {
class StatisticsProvider;
@@ -179,6 +180,14 @@ class ServicesCustomizationDocument : public CustomizationDocument,
// Remove instance of ServicesCustomizationDocument for tests.
static void ShutdownForTesting();
+ // 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();
+
+ // This is called by CustomizationWallpaperDownloader to destroy self.
+ void DestroyWallpaperDownloader();
+
private:
friend struct DefaultSingletonTraits<ServicesCustomizationDocument>;
@@ -237,6 +246,23 @@ class ServicesCustomizationDocument : public CustomizationDocument,
const std::string& locale,
const base::DictionaryValue& root) const;
+ // Start download of wallpaper image if need.
Daniel Erat 2014/04/14 15:26:15 nit: s/need/needed/
Alexander Alekseev 2014/04/15 01:57:16 Done.
+ 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>);
Daniel Erat 2014/04/14 15:26:15 name this parameter
Alexander Alekseev 2014/04/15 01:57:16 Done.
+
+ // Called after downloaded wallpaper has been checked.
+ void ApplyWallpaper(bool default_wallpaper_file_exists);
+
+ // Set Shell default wallpaper to customized.
+ // It's wrapped as a callback and passed as a parameter to
+ // CustomizationWallpaperDownloader.
+ void OnCustomizedWallpaperDownloaded(const GURL& wallpaper_url);
+
// Services customization manifest URL.
GURL url_;
@@ -258,6 +284,8 @@ class ServicesCustomizationDocument : public CustomizationDocument,
// Weak factory for callbacks.
base::WeakPtrFactory<ServicesCustomizationDocument> weak_ptr_factory_;
+ scoped_ptr<CustomizationWallpaperDownloader> wallpaper_downloader_;
Daniel Erat 2014/04/14 15:26:15 weak_ptr_factory_ should come last in the class de
Alexander Alekseev 2014/04/15 01:57:16 Done.
+
DISALLOW_COPY_AND_ASSIGN(ServicesCustomizationDocument);
};

Powered by Google App Engine
This is Rietveld 408576698