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..48a0ce433ad6c47e112e5985e0b78ddf462e273d 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'); |
@@ -488,9 +487,17 @@ function WallpaperManager(dialogDom) { |
selectedItem.layout, |
selectedItem.source, |
function(exists) { |
+ var wallpaperInfo = { |
+ url: wallpaperURL, |
+ layout: selectedItem.layout, |
+ source: selectedItem.source |
+ }; |
+ |
if (exists) { |
self.currentWallpaper_ = wallpaperURL; |
self.wallpaperGrid_.activeItem = selectedItem; |
+ WallpaperUtil.saveToStorage(Constants.AccessWallpaperInfoKey, |
+ wallpaperInfo, true); |
return; |
} |
@@ -507,6 +514,8 @@ function WallpaperManager(dialogDom) { |
wallpaperURL, |
self.onFinished_.bind(self, selectedGridItem, selectedItem)); |
self.currentWallpaper_ = wallpaperURL; |
+ WallpaperUtil.saveToStorage(Constants.AccessWallpaperInfoKey, |
+ wallpaperInfo, true); |
self.wallpaperRequest_ = null; |
}; |
var onFailure = function() { |
@@ -729,8 +738,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 +834,13 @@ function WallpaperManager(dialogDom) { |
failure(); |
} else { |
success(opt_thumbnail); |
+ var wallpaperInfo = { |
+ url: wallpaper, |
+ layout: layout, |
+ source: Constants.WallpaperSourceEnum.Custom |
+ }; |
+ WallpaperUtil.saveToStorage(Constants.AccessWallpaperInfoKey, |
+ wallpaperInfo, true); |
} |
}; |
@@ -867,7 +883,7 @@ function WallpaperManager(dialogDom) { |
self.removeCustomWallpaper(fileName); |
$('set-wallpaper-layout').disabled = true; |
} else { |
- WallpaperUtil.saveToLocalStorage(self.currentWallpaper_, layout); |
+ WallpaperUtil.saveToStorage(self.currentWallpaper_, layout, false); |
} |
}); |
}; |