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

Unified Diff: chrome/browser/resources/file_manager/js/cws_container_client.js

Issue 23717007: [Files.app] Refinement events of suggest app dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 4 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: chrome/browser/resources/file_manager/js/cws_container_client.js
diff --git a/chrome/browser/resources/file_manager/js/cws_container_client.js b/chrome/browser/resources/file_manager/js/cws_container_client.js
index 9e7718f4d5a188c632f825a706f402b637ab9639..6172b7319eacd19820e731958d90af3320cc94c7 100644
--- a/chrome/browser/resources/file_manager/js/cws_container_client.js
+++ b/chrome/browser/resources/file_manager/js/cws_container_client.js
@@ -47,7 +47,10 @@ CWSContainerClient.prototype.onMessage_ = function(event) {
var data = event.data;
switch (data['message']) {
case 'widget_loaded':
- // Do nothing. Waits for user action and next message.
+ this.onWidgetLoaded_();
+ break;
+ case 'widget_load_failed':
+ this.onWidgetLoadFailed_();
break;
case 'before_install':
this.sendInstallRequest_(data['item_id']);
@@ -70,12 +73,28 @@ CWSContainerClient.prototype.onLoadStop_ = function(event) {
};
/**
+ * Called when the widget is loaded successfully.
+ * @private
+ */
+CWSContainerClient.prototype.onWidgetLoaded_ = function() {
+ this.dispatchEvent(new cr.Event('loaded'));
hirono 2013/08/30 09:06:19 Can we make the event names enum values? To do thi
yoshiki 2013/08/30 09:16:03 Done.
+};
+
+/**
+ * Called when the widget is failed to load.
+ * @private
+ */
+CWSContainerClient.prototype.onWidgetLoadFailed_ = function() {
+ this.sendWidgetLoadFailed_();
+};
+
+/**
* Called when receiving the 'loadabort' event from <webview>.
* @param {Event} event Message event.
* @private
*/
CWSContainerClient.prototype.onLoadAbort_ = function(event) {
- this.sendWebviewLoadAbort_();
+ this.sendWidgetLoadFailed_();
};
/**
@@ -92,11 +111,11 @@ CWSContainerClient.prototype.onInstallCompleted = function(result, itemId) {
};
/**
- * Send the abort event to the suggest-app dialog.
+ * Send the fail message to the suggest-app dialog.
* @private
*/
-CWSContainerClient.prototype.sendWebviewLoadAbort_ = function() {
- this.dispatchEvent(new cr.Event('webview-load-abort'));
+CWSContainerClient.prototype.sendWidgetLoadFailed_ = function() {
+ this.dispatchEvent(new cr.Event('load-failed'));
};
/**
« no previous file with comments | « chrome/browser/resources/file_manager/css/file_manager.css ('k') | chrome/browser/resources/file_manager/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698