| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** @suppress {duplicate} */ | 5 /** @suppress {duplicate} */ |
| 6 var remoting = remoting || {}; | 6 var remoting = remoting || {}; |
| 7 | 7 |
| 8 (function() { | 8 (function() { |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 this.eventHooks_ = new base.Disposables( | 47 this.eventHooks_ = new base.Disposables( |
| 48 new base.DomEventHook(this.formElement_, 'submit', onOk, false), | 48 new base.DomEventHook(this.formElement_, 'submit', onOk, false), |
| 49 new base.DomEventHook(this.cancelButton_, 'click', onCancel, false)); | 49 new base.DomEventHook(this.cancelButton_, 'click', onCancel, false)); |
| 50 base.debug.assert(this.deferred_ === null); | 50 base.debug.assert(this.deferred_ === null); |
| 51 this.deferred_ = new base.Deferred(); | 51 this.deferred_ = new base.Deferred(); |
| 52 remoting.setMode(this.appMode_); | 52 remoting.setMode(this.appMode_); |
| 53 return this.deferred_.promise(); | 53 return this.deferred_.promise(); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 /** @return {HTMLElement} */ |
| 57 remoting.InputDialog.prototype.inputField = function() { |
| 58 return this.inputField_; |
| 59 } |
| 60 |
| 56 /** @private */ | 61 /** @private */ |
| 57 remoting.InputDialog.prototype.onSubmit_ = function() { | 62 remoting.InputDialog.prototype.onSubmit_ = function() { |
| 58 this.deferred_.resolve(this.inputField_.value); | 63 this.deferred_.resolve(this.inputField_.value); |
| 59 } | 64 } |
| 60 | 65 |
| 61 /** @private */ | 66 /** @private */ |
| 62 remoting.InputDialog.prototype.onCancel_ = function() { | 67 remoting.InputDialog.prototype.onCancel_ = function() { |
| 63 this.deferred_.reject(new remoting.Error(remoting.Error.Tag.CANCELLED)); | 68 this.deferred_.reject(new remoting.Error(remoting.Error.Tag.CANCELLED)); |
| 64 } | 69 } |
| 65 | 70 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 79 // clipboard-handling bug - http://crbug.com/281523. | 84 // clipboard-handling bug - http://crbug.com/281523. |
| 80 that.cancelButton_.focus(); | 85 that.cancelButton_.focus(); |
| 81 handler(); | 86 handler(); |
| 82 base.dispose(that.eventHooks_); | 87 base.dispose(that.eventHooks_); |
| 83 that.eventHooks_ = null; | 88 that.eventHooks_ = null; |
| 84 that.deferred_ = null; | 89 that.deferred_ = null; |
| 85 }; | 90 }; |
| 86 }; | 91 }; |
| 87 | 92 |
| 88 })(); | 93 })(); |
| OLD | NEW |