Index: chrome/browser/resources/chromeos/wallpaper_manager/js/util.js |
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js |
index 90191d6b15f41baf2342ae7787a493e2e2821a8d..b1e402d9aa2b314772fabba9ada6cea8b290e01c 100644 |
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js |
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js |
@@ -77,13 +77,28 @@ WallpaperUtil.deleteWallpaperFromSyncFS = function(wallpaperFilename) { |
function(fe) { |
fe.remove(function() {}, null); |
}, |
- WallpaperUtil.onFileSystemError); |
+ function(e) { |
+ // NotFoundError is expected under the following scenario: |
+ // The user uses a same account on device A and device B. |
+ // The current wallpaper is a third party wallpaper. Then |
+ // the user changes it to a ONLINE wallpaper on device A. |
+ // Sync file system change and local file system change |
+ // will then both be fired on device B, which makes the |
+ // third party wallpaper be deleted twice from the sync |
+ // file system. We should ignore this error. |
+ if (e.name != 'NotFoundError') |
+ WallpaperUtil.onFileSystemError(e); |
+ }); |
fs.root.getFile(thumbnailFilename, |
{create: false}, |
function(fe) { |
fe.remove(function() {}, null); |
}, |
- WallpaperUtil.onFileSystemError); |
+ function(e) { |
+ // Same as above. |
+ if (e.name != 'NotFoundError') |
+ WallpaperUtil.onFileSystemError(e); |
+ }); |
}; |
WallpaperUtil.requestSyncFS(success); |
}; |