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

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

Issue 1004513002: Eliminated named constants for instances of remoting.Error. (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_daemon_facade.js ('k') | remoting/webapp/crd/js/host_installer.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 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 /** 10 /**
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 /** @type {remoting.HostInstaller} */ 61 /** @type {remoting.HostInstaller} */
62 var hostInstaller = new remoting.HostInstaller(); 62 var hostInstaller = new remoting.HostInstaller();
63 63
64 /** @type {remoting.HostInstallDialog} */ 64 /** @type {remoting.HostInstallDialog} */
65 var that = this; 65 var that = this;
66 66
67 this.hostInstaller_.downloadAndWaitForInstall().then(function() { 67 this.hostInstaller_.downloadAndWaitForInstall().then(function() {
68 that.continueInstallButton_.click(); 68 that.continueInstallButton_.click();
69 that.hostInstaller_.cancel(); 69 that.hostInstaller_.cancel();
70 }, function(){ 70 }, function(){
71 that.onErrorHandler_(remoting.Error.CANCELLED); 71 that.onErrorHandler_(new remoting.Error(remoting.Error.Tag.CANCELLED));
72 that.hostInstaller_.cancel(); 72 that.hostInstaller_.cancel();
73 }); 73 });
74 }; 74 };
75 75
76 /** 76 /**
77 * In manual host installation, onDone handler must call this method if it 77 * In manual host installation, onDone handler must call this method if it
78 * detects that the host components are still unavailable. The same onDone 78 * detects that the host components are still unavailable. The same onDone
79 * and onError callbacks will be used when user clicks Ok or Cancel. 79 * and onError callbacks will be used when user clicks Ok or Cancel.
80 */ 80 */
81 remoting.HostInstallDialog.prototype.tryAgain = function() { 81 remoting.HostInstallDialog.prototype.tryAgain = function() {
(...skipping 14 matching lines...) Expand all
96 96
97 this.onDoneHandler_(); 97 this.onDoneHandler_();
98 }; 98 };
99 99
100 remoting.HostInstallDialog.prototype.onCancelClicked_ = function() { 100 remoting.HostInstallDialog.prototype.onCancelClicked_ = function() {
101 this.continueInstallButton_.removeEventListener( 101 this.continueInstallButton_.removeEventListener(
102 'click', this.onOkClickedHandler_, false); 102 'click', this.onOkClickedHandler_, false);
103 this.cancelInstallButton_.removeEventListener( 103 this.cancelInstallButton_.removeEventListener(
104 'click', this.onCancelClickedHandler_, false); 104 'click', this.onCancelClickedHandler_, false);
105 this.hostInstaller_.cancel(); 105 this.hostInstaller_.cancel();
106 this.onErrorHandler_(remoting.Error.CANCELLED); 106 this.onErrorHandler_(new remoting.Error(remoting.Error.Tag.CANCELLED));
107 }; 107 };
108 108
109 remoting.HostInstallDialog.prototype.onRetryClicked_ = function() { 109 remoting.HostInstallDialog.prototype.onRetryClicked_ = function() {
110 this.retryInstallButton_.removeEventListener( 110 this.retryInstallButton_.removeEventListener(
111 'click', this.onRetryClickedHandler_.bind(this), false); 111 'click', this.onRetryClickedHandler_.bind(this), false);
112 this.continueInstallButton_.addEventListener( 112 this.continueInstallButton_.addEventListener(
113 'click', this.onOkClickedHandler_, false); 113 'click', this.onOkClickedHandler_, false);
114 this.cancelInstallButton_.addEventListener( 114 this.cancelInstallButton_.addEventListener(
115 'click', this.onCancelClickedHandler_, false); 115 'click', this.onCancelClickedHandler_, false);
116 remoting.setMode(remoting.AppMode.HOST_INSTALL_PROMPT); 116 remoting.setMode(remoting.AppMode.HOST_INSTALL_PROMPT);
117 }; 117 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/host_daemon_facade.js ('k') | remoting/webapp/crd/js/host_installer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698