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

Unified Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js

Issue 14416017: Sync online wallpaper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 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/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
index 5b3690af3d92fcb1ea7631bf6188f11783c16594..ca495251639f85ca6ca55c18b951a88c268685a8 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
@@ -172,7 +172,7 @@ function WallpaperManager(dialogDom) {
*/
WallpaperManager.prototype.onLoadManifestSuccess_ = function(manifest) {
this.manifest_ = manifest;
- WallpaperUtil.saveToLocalStorage(Constants.AccessManifestKey, manifest);
+ WallpaperUtil.saveToStorage(Constants.AccessManifestKey, manifest, false);
this.initDom_();
};
@@ -197,9 +197,8 @@ function WallpaperManager(dialogDom) {
WallpaperManager.prototype.toggleSurpriseMe_ = function() {
var checkbox = $('surprise-me').querySelector('#checkbox');
var shouldEnable = !checkbox.classList.contains('checked');
- WallpaperUtil.saveToLocalStorage(Constants.AccessSurpriseMeEnabledKey,
- shouldEnable,
- function() {
+ WallpaperUtil.saveToStorage(Constants.AccessSurpriseMeEnabledKey,
+ shouldEnable, false, function() {
if (chrome.runtime.lastError == null) {
if (shouldEnable) {
checkbox.classList.add('checked');
@@ -491,6 +490,8 @@ function WallpaperManager(dialogDom) {
if (exists) {
self.currentWallpaper_ = wallpaperURL;
self.wallpaperGrid_.activeItem = selectedItem;
+ WallpaperUtil.saveWallpaperInfo(wallpaperURL, selectedItem.layout,
+ selectedItem.source);
return;
}
@@ -507,6 +508,8 @@ function WallpaperManager(dialogDom) {
wallpaperURL,
self.onFinished_.bind(self, selectedGridItem, selectedItem));
self.currentWallpaper_ = wallpaperURL;
+ WallpaperUtil.saveWallpaperInfo(wallpaperURL, selectedItem.layout,
+ selectedItem.source);
self.wallpaperRequest_ = null;
};
var onFailure = function() {
@@ -729,8 +732,8 @@ function WallpaperManager(dialogDom) {
self.wallpaperGrid_.selectedItem = wallpaperInfo;
self.wallpaperGrid_.activeItem = wallpaperInfo;
self.currentWallpaper_ = fileName;
- WallpaperUtil.saveToLocalStorage(self.currentWallpaper_,
- layout);
+ WallpaperUtil.saveToStorage(self.currentWallpaper_, layout,
+ false);
};
fileWriter.onerror = errorHandler;
@@ -825,6 +828,8 @@ function WallpaperManager(dialogDom) {
failure();
} else {
success(opt_thumbnail);
+ WallpaperUtil.saveWallpaperInfo(fileName, layout,
+ Constants.WallpaperSourceEnum.Custom);
}
};
@@ -867,7 +872,7 @@ function WallpaperManager(dialogDom) {
self.removeCustomWallpaper(fileName);
$('set-wallpaper-layout').disabled = true;
} else {
- WallpaperUtil.saveToLocalStorage(self.currentWallpaper_, layout);
+ WallpaperUtil.saveToStorage(self.currentWallpaper_, layout, false);
}
});
};

Powered by Google App Engine
This is Rietveld 408576698