| 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 /** @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'; |
| 11 | 11 |
| 12 var instance_ = null; | 12 var instance_ = null; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * @constructor | 15 * @constructor |
| 16 * @implements {remoting.WindowShape.ClientUI} | 16 * @implements {remoting.WindowShape.ClientUI} |
| 17 * @implements {remoting.Identity.ConsentDialog} | 17 * @implements {remoting.Identity.ConsentDialog} |
| 18 * @param {HTMLElement} rootElement The dialog DOM element. | 18 * @param {HTMLElement} rootElement The dialog DOM element. |
| 19 * @private | 19 * @private |
| 20 */ | 20 */ |
| 21 remoting.AuthDialog = function(rootElement) { | 21 remoting.AuthDialog = function(rootElement) { |
| 22 /** | 22 /** @private {HTMLElement} */ |
| 23 * @type {HTMLElement} | |
| 24 * @private | |
| 25 */ | |
| 26 this.rootElement_ = rootElement; | 23 this.rootElement_ = rootElement; |
| 27 | 24 |
| 28 /** | 25 /** @private {HTMLElement} */ |
| 29 * @type {HTMLElement} | |
| 30 * @private | |
| 31 */ | |
| 32 this.borderElement_ = rootElement.querySelector('#auth-dialog-border'); | 26 this.borderElement_ = rootElement.querySelector('#auth-dialog-border'); |
| 33 | 27 |
| 34 /** | 28 /** @private {HTMLElement} */ |
| 35 * @type {HTMLElement} | |
| 36 * @private | |
| 37 */ | |
| 38 this.authButton_ = rootElement.querySelector('#auth-button'); | 29 this.authButton_ = rootElement.querySelector('#auth-button'); |
| 39 | 30 |
| 40 /** | 31 /** @private {base.Deferred} */ |
| 41 * @type {base.Deferred} | |
| 42 * @private | |
| 43 */ | |
| 44 this.onAuthButtonDeferred_ = null; | 32 this.onAuthButtonDeferred_ = null; |
| 45 | 33 |
| 46 this.authButton_.addEventListener('click', this.onClick_.bind(this), false); | 34 this.authButton_.addEventListener('click', this.onClick_.bind(this), false); |
| 47 remoting.windowShape.addCallback(this); | 35 remoting.windowShape.addCallback(this); |
| 48 }; | 36 }; |
| 49 | 37 |
| 50 /** | 38 /** |
| 51 * @param {Array<{left: number, top: number, width: number, height: number}>} | 39 * @param {Array<{left: number, top: number, width: number, height: number}>} |
| 52 * rects List of rectangles. | 40 * rects List of rectangles. |
| 53 */ | 41 */ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 */ | 83 */ |
| 96 remoting.AuthDialog.getInstance = function() { | 84 remoting.AuthDialog.getInstance = function() { |
| 97 if (!instance_) { | 85 if (!instance_) { |
| 98 var rootElement = document.getElementById('auth-dialog'); | 86 var rootElement = document.getElementById('auth-dialog'); |
| 99 instance_ = new remoting.AuthDialog(rootElement); | 87 instance_ = new remoting.AuthDialog(rootElement); |
| 100 } | 88 } |
| 101 return instance_; | 89 return instance_; |
| 102 }; | 90 }; |
| 103 | 91 |
| 104 })(); | 92 })(); |
| OLD | NEW |