| Index: chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
|
| diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
|
| index 800b25477dc1836503281fb8c58dd3c963345ed3..194d35f2a12a8a73fed1b7f8ec8016faf2f7c8e4 100644
|
| --- a/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
|
| +++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
|
| @@ -319,7 +319,8 @@ chrome.storage.onChanged.addListener(function(changes, namespace) {
|
| // If the old wallpaper is a third party wallpaper we should remove it
|
| // from the local & sync file system to free space.
|
| var oldInfo = changes[Constants.AccessLocalWallpaperInfoKey].oldValue;
|
| - if (oldInfo.url.indexOf(Constants.ThirdPartyWallpaperPrefix) != -1) {
|
| + if (oldInfo &&
|
| + oldInfo.url.indexOf(Constants.ThirdPartyWallpaperPrefix) != -1) {
|
| WallpaperUtil.deleteWallpaperFromLocalFS(oldInfo.url);
|
| WallpaperUtil.deleteWallpaperFromSyncFS(oldInfo.url);
|
| }
|
| @@ -372,6 +373,7 @@ chrome.storage.onChanged.addListener(function(changes, namespace) {
|
| } else if (syncInfo.source ==
|
| Constants.WallpaperSourceEnum.Default) {
|
| chrome.wallpaperPrivate.resetWallpaper();
|
| + WallpaperUtil.clearThirdPartyAppName();
|
| }
|
|
|
| // If the old wallpaper is a third party wallpaper we should
|
| @@ -409,7 +411,7 @@ chrome.alarms.onAlarm.addListener(function() {
|
| });
|
|
|
| chrome.wallpaperPrivate.onWallpaperChangedBy3rdParty.addListener(function(
|
| - wallpaper, thumbnail, layout) {
|
| + wallpaper, thumbnail, layout, appname) {
|
| WallpaperUtil.saveToLocalStorage(
|
| Constants.AccessLocalSurpriseMeEnabledKey, false, function() {
|
| WallpaperUtil.saveToSyncStorage(Constants.AccessSyncSurpriseMeEnabledKey,
|
| @@ -418,11 +420,11 @@ chrome.wallpaperPrivate.onWallpaperChangedBy3rdParty.addListener(function(
|
| SurpriseWallpaper.getInstance().disable();
|
|
|
| // Make third party wallpaper syncable through different devices.
|
| - // TODO(xdai): also sync the third party app name.
|
| var filename = Constants.ThirdPartyWallpaperPrefix + new Date().getTime();
|
| var thumbnailFilename = filename + Constants.CustomWallpaperThumbnailSuffix;
|
| WallpaperUtil.storeWallpaperToSyncFS(filename, wallpaper);
|
| WallpaperUtil.storeWallpaperToSyncFS(thumbnailFilename, thumbnail);
|
| WallpaperUtil.saveWallpaperInfo(filename, layout,
|
| Constants.WallpaperSourceEnum.Custom);
|
| + WallpaperUtil.saveThirdPartyAppName(appname);
|
| });
|
|
|