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 272fb2224869217f606fdcab88c9186bd51be5f4..0722977066d97e3cddd7cda23b66c2e5f4b5830c 100644 |
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js |
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js |
@@ -306,9 +306,11 @@ WallpaperUtil.saveWallpaperInfo = function(url, layout, source) { |
* @param {function} onSuccess The success callback. It must be called with |
* current XMLHttprequest object. |
* @param {function} onFailure The failure callback. |
+ * @param {function} onNotFound The not found callback. |
* @param {XMLHttpRequest=} opt_xhr The XMLHttpRequest object. |
*/ |
-WallpaperUtil.fetchURL = function(url, type, onSuccess, onFailure, opt_xhr) { |
+WallpaperUtil.fetchURL = function( |
+ url, type, onSuccess, onFailure, onNotFound, opt_xhr) { |
bshe
2015/03/09 14:16:09
I think it is probably better to handle onNotFound
xdai1
2015/03/09 21:07:10
Done.
|
var xhr; |
if (opt_xhr) |
xhr = opt_xhr; |
@@ -322,6 +324,9 @@ WallpaperUtil.fetchURL = function(url, type, onSuccess, onFailure, opt_xhr) { |
xhr.addEventListener('load', function(e) { |
if (this.status == 200) { |
onSuccess(this); |
+ } else if (this.status == 404) { |
+ if (onNotFound) |
+ onNotFound(); |
} else { |
onFailure(); |
} |