| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |