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

Unified Diff: remoting/webapp/crd/js/host_list.js

Issue 1020743002: [Chromoting] Move app-specific code out of remoting.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: remoting/webapp/crd/js/host_list.js
diff --git a/remoting/webapp/crd/js/host_list.js b/remoting/webapp/crd/js/host_list.js
index 86269096afb9c65259cbefdf3ca95428ee9c904f..a618ef6dedabfaeced29ca87bef19d1825c0bb77 100644
--- a/remoting/webapp/crd/js/host_list.js
+++ b/remoting/webapp/crd/js/host_list.js
@@ -26,9 +26,11 @@ var remoting = remoting || {};
* @param {HTMLElement} loadingIndicator The HTML <span> to update while the
* host list is being loaded. The first element of this span should be
* the reload button.
+ * @param {function(!remoting.Error)} onError Function to call when an error
+ * occurs.
*/
remoting.HostList = function(table, noHosts, errorMsg, errorButton,
- loadingIndicator) {
+ loadingIndicator, onError) {
/** @private {Element} */
this.table_ = table;
/**
@@ -43,6 +45,8 @@ remoting.HostList = function(table, noHosts, errorMsg, errorButton,
this.errorButton_ = errorButton;
/** @private {HTMLElement} */
this.loadingIndicator_ = loadingIndicator;
+ this.onError_ = onError;
+
/** @private {Array<remoting.HostTableEntry>} */
this.hostTableEntries_ = [];
/** @private {Array<remoting.Host>} */
@@ -295,7 +299,7 @@ remoting.HostList.prototype.deleteHost_ = function(hostTableEntry) {
this.hostTableEntries_.splice(index, 1);
}
remoting.hostListApi.remove(hostTableEntry.host.hostId, base.doNothing,
- remoting.showErrorMessage);
+ this.onError_);
};
/**
@@ -316,7 +320,7 @@ remoting.HostList.prototype.renameHost = function(hostTableEntry) {
hostTableEntry.host.hostName,
hostTableEntry.host.publicKey,
function() {},
- remoting.showErrorMessage);
+ this.onError_);
};
/**
@@ -343,7 +347,7 @@ remoting.HostList.prototype.unregisterHostById = function(hostId, opt_onDone) {
onDone();
});
};
- remoting.hostListApi.remove(hostId, onRemoved, remoting.showErrorMessage);
+ remoting.hostListApi.remove(hostId, onRemoved, this.onError_);
};
/**

Powered by Google App Engine
This is Rietveld 408576698