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

Unified Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js

Issue 11066090: Show custom wallpaper container and cannot access wallpaper message when device offline. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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 | « no previous file | 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 7c2040cddfc743df4adf768e2dea57cc142bf04e..51855ae975bbc6437bcfa2aef8d1706c98f2f2b9 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
@@ -84,21 +84,26 @@ function WallpaperManager(dialogDom) {
var xhr = new XMLHttpRequest();
var locale = navigator.language;
xhr.open('GET', ManifestBaseURL + locale + '.json', false);
- xhr.send(null);
- // TODO(bshe): We should save the downloaded manifest to local disk. Other
- // components may want to use it (i.e. screen saver).
- if (xhr.status === 200) {
- this.parseManifest_(xhr.responseText);
- } else {
- // Fall back to en locale if current locale is not supported.
- xhr.open('GET', ManifestBaseURL + 'en.json', false);
+ try {
xhr.send(null);
+ // TODO(bshe): We should save the downloaded manifest to local disk. Other
+ // components may want to use it (i.e. screen saver).
if (xhr.status === 200) {
this.parseManifest_(xhr.responseText);
} else {
- this.manifest_ = {};
- this.butterBar_.showError_(str('connectionFailed'));
+ // Fall back to en locale if current locale is not supported.
+ xhr.open('GET', ManifestBaseURL + 'en.json', false);
+ xhr.send(null);
+ if (xhr.status === 200) {
+ this.parseManifest_(xhr.responseText);
flackr 2012/10/16 15:29:48 This nested structure which does the same thing to
bshe 2012/10/16 16:01:48 Done. On 2012/10/16 15:29:48, flackr wrote:
+ } else {
+ this.manifest_ = {};
+ this.butterBar_.showError_(str('connectionFailed'));
+ }
}
+ } catch (e) {
+ this.manifest_ = {};
+ this.butterBar_.showError_(str('connectionFailed'));
}
// TODO(bshe): Fall back to saved manifest if there is a problem fetching
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698