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

Unified Diff: components/chrome_apps/webstore_widget/cws_widget/cws_widget_container.js

Issue 1129083006: Show an error dialog if Chrome Web Store widget fails to load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launching_webstore_widget_app
Patch Set: . Created 5 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
Index: components/chrome_apps/webstore_widget/cws_widget/cws_widget_container.js
diff --git a/components/chrome_apps/webstore_widget/cws_widget/cws_widget_container.js b/components/chrome_apps/webstore_widget/cws_widget/cws_widget_container.js
index 7cffe7a7255273ac698c03542c1edcb315920ffe..55640997f0c8e5bd44728daa0ba2bc6ac74e0fbc 100644
--- a/components/chrome_apps/webstore_widget/cws_widget/cws_widget_container.js
+++ b/components/chrome_apps/webstore_widget/cws_widget/cws_widget_container.js
@@ -369,6 +369,8 @@ CWSWidgetContainer.prototype.ready = function() {
return;
}
+ this.spinnerLayerController_.setVisible(true);
+
this.metricsRecorder_.recordShowDialog();
this.metricsRecorder_.startLoad();
@@ -379,6 +381,7 @@ CWSWidgetContainer.prototype.ready = function() {
this.accessToken_ = accessToken;
resolve();
}.bind(this), function(error) {
+ this.spinnerLayerController_.setVisible(false);
this.state_ = CWSWidgetContainer.State.UNINITIALIZED;
reject('Failed to get Web Store access token: ' + error);
}.bind(this));
@@ -823,8 +826,7 @@ CWSWidgetContainer.SpinnerLayerController.prototype.setVisible =
this.visible_ = visible;
// Spinner should be shown during transition.
- if (!this.spinnerLayer_.classList.contains('cws-widget-show-spinner'))
- this.spinnerLayer_.classList.add('cws-widget-show-spinner');
+ this.spinnerLayer_.classList.toggle('cws-widget-show-spinner', true);
if (this.visible_) {
this.spinnerLayer_.focus();

Powered by Google App Engine
This is Rietveld 408576698