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

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: Deleted DBC::SetDefaultWallpaper. 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
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..916ef8b67e5193a50f38bce54612da75a88adb99 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,8 +178,14 @@ 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();
+
private:
friend struct DefaultSingletonTraits<ServicesCustomizationDocument>;
+ friend class CustomizationWallpaperDownloader;
Dmitry Polukhin 2014/03/27 04:36:32 What exactly do you need from private interface of
Alexander Alekseev 2014/03/31 14:15:40 OnCustomizedWallpaperDownloaded(); Ok, let's make
typedef std::vector<base::WeakPtr<ServicesCustomizationExternalLoader> >
ExternalLoaders;
@@ -235,6 +242,24 @@ class ServicesCustomizationDocument : public CustomizationDocument,
const std::string& locale,
const base::DictionaryValue& root) const;
+ // Set Shell default wallpaper to customized.
+ static void SetDefaultWallpaperPath(const GURL& wallpaper_url);
Daniel Erat 2014/03/27 01:45:50 nit: SetDefaultWallpaperURL -- "Path" makes it sou
Alexander Alekseev 2014/03/31 14:15:40 Done.
+
+ // 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_;
@@ -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);
};

Powered by Google App Engine
This is Rietveld 408576698