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

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: add comment Created 7 years, 7 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 | « chrome/browser/resources/chromeos/wallpaper_manager/js/util.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d28c8cd8cca5c77a49dcbea6bba89b1ebb25c75a 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,10 @@ function WallpaperManager(dialogDom) {
failure();
} else {
success(opt_thumbnail);
+ // Custom wallpapers are not synced yet. If login on a different
+ // computer after set a custom wallpaper, wallpaper wont change by sync.
+ WallpaperUtil.saveWallpaperInfo(fileName, layout,
+ Constants.WallpaperSourceEnum.Custom);
}
};
@@ -867,7 +874,7 @@ function WallpaperManager(dialogDom) {
self.removeCustomWallpaper(fileName);
$('set-wallpaper-layout').disabled = true;
} else {
- WallpaperUtil.saveToLocalStorage(self.currentWallpaper_, layout);
+ WallpaperUtil.saveToStorage(self.currentWallpaper_, layout, false);
}
});
};
« no previous file with comments | « chrome/browser/resources/chromeos/wallpaper_manager/js/util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698