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

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: Make isMe2MeInstallable private 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
« no previous file with comments | « remoting/webapp/crd/js/desktop_remoting.js ('k') | remoting/webapp/crd/js/host_setup_dialog.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5d7d875471b9b4af938bbc0419f12e97b3c403dc 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>} */
@@ -53,7 +57,8 @@ remoting.HostList = function(table, noHosts, errorMsg, errorButton,
this.localHostSection_ = new remoting.LocalHostSection(
/** @type {HTMLElement} */ (document.querySelector('.daemon-control')),
new remoting.LocalHostSection.Controller(
- this, new remoting.HostSetupDialog(remoting.hostController)));
+ this,
+ new remoting.HostSetupDialog(remoting.hostController, onError)));
/** @private {number} */
this.webappMajorVersion_ = parseInt(chrome.runtime.getManifest().version, 10);
@@ -295,7 +300,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 +321,7 @@ remoting.HostList.prototype.renameHost = function(hostTableEntry) {
hostTableEntry.host.hostName,
hostTableEntry.host.publicKey,
function() {},
- remoting.showErrorMessage);
+ this.onError_);
};
/**
@@ -343,7 +348,7 @@ remoting.HostList.prototype.unregisterHostById = function(hostId, opt_onDone) {
onDone();
});
};
- remoting.hostListApi.remove(hostId, onRemoved, remoting.showErrorMessage);
+ remoting.hostListApi.remove(hostId, onRemoved, this.onError_);
};
/**
« no previous file with comments | « remoting/webapp/crd/js/desktop_remoting.js ('k') | remoting/webapp/crd/js/host_setup_dialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698