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

Side by Side Diff: remoting/webapp/crd/js/host_installer.js

Issue 955283002: Converted remoting.Error from an enum to a class (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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/crd/js/host_install_dialog.js ('k') | remoting/webapp/crd/js/host_list.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 7 *
8 * HostInstaller allows the caller to download the host binary and monitor the 8 * HostInstaller allows the caller to download the host binary and monitor the
9 * install progress of the host by pinging the host periodically via native 9 * install progress of the host by pinging the host periodically via native
10 * messaging. 10 * messaging.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 }; 99 };
100 100
101 /** 101 /**
102 * @throws {Error} Throws if there is no matching host binary for the current 102 * @throws {Error} Throws if there is no matching host binary for the current
103 * platform. 103 * platform.
104 */ 104 */
105 remoting.HostInstaller.prototype.download = function() { 105 remoting.HostInstaller.prototype.download = function() {
106 var hostPackageUrl = HOST_DOWNLOAD_URLS[navigator.platform]; 106 var hostPackageUrl = HOST_DOWNLOAD_URLS[navigator.platform];
107 if (hostPackageUrl === undefined) { 107 if (hostPackageUrl === undefined) {
108 console.error("Tried to install host on " + navigator.platform); 108 console.error("Tried to install host on " + navigator.platform);
109 throw new Error(remoting.Error.UNEXPECTED); 109 throw new Error(remoting.Error.unexpected());
110 } 110 }
111 111
112 // Start downloading the package. 112 // Start downloading the package.
113 if (base.isAppsV2()) { 113 if (base.isAppsV2()) {
114 // TODO(jamiewalch): Use chrome.downloads when it is available to 114 // TODO(jamiewalch): Use chrome.downloads when it is available to
115 // apps v2 (http://crbug.com/174046) 115 // apps v2 (http://crbug.com/174046)
116 window.open(hostPackageUrl); 116 window.open(hostPackageUrl);
117 } else { 117 } else {
118 window.location = hostPackageUrl; 118 window.location = hostPackageUrl;
119 } 119 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 */ 165 */
166 remoting.HostInstaller.prototype.cancel = function() { 166 remoting.HostInstaller.prototype.cancel = function() {
167 if (this.checkInstallIntervalId_ !== null) { 167 if (this.checkInstallIntervalId_ !== null) {
168 window.clearInterval(this.checkInstallIntervalId_); 168 window.clearInterval(this.checkInstallIntervalId_);
169 this.checkInstallIntervalId_ = null; 169 this.checkInstallIntervalId_ = null;
170 } 170 }
171 this.downloadAndWaitForInstallPromise_ = null; 171 this.downloadAndWaitForInstallPromise_ = null;
172 }; 172 };
173 173
174 })(); 174 })();
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/host_install_dialog.js ('k') | remoting/webapp/crd/js/host_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698