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 /** |
11 * Namespace for window manager functions. | 11 * Namespace for window manager functions. |
12 * @type {Object} | 12 * @type {Object} |
13 */ | 13 */ |
14 remoting.MessageWindowManager = {}; | 14 remoting.MessageWindowManager = {}; |
15 | 15 |
16 /** | 16 /** |
17 * Mapping from window id to corresponding MessageWindow. | 17 * Mapping from window id to corresponding MessageWindow. |
18 * | 18 * |
19 * @type {Object<number, remoting.MessageWindow>} | 19 * @private {Object<number, remoting.MessageWindow>} |
20 * @private | |
21 */ | 20 */ |
22 remoting.MessageWindowManager.messageWindows_ = {}; | 21 remoting.MessageWindowManager.messageWindows_ = {}; |
23 | 22 |
24 /** | 23 /** |
25 * The next window id to auto-assign. | 24 * The next window id to auto-assign. |
26 * @type {number} | 25 * @private {number} |
27 * @private | |
28 */ | 26 */ |
29 remoting.MessageWindowManager.nextId_ = 1; | 27 remoting.MessageWindowManager.nextId_ = 1; |
30 | 28 |
31 /** | 29 /** |
32 * @param {remoting.MessageWindow} window The window to associate | 30 * @param {remoting.MessageWindow} window The window to associate |
33 * with the window id. | 31 * with the window id. |
34 * @return {number} The window id. | 32 * @return {number} The window id. |
35 */ | 33 */ |
36 remoting.MessageWindowManager.addMessageWindow = function(window) { | 34 remoting.MessageWindowManager.addMessageWindow = function(window) { |
37 var id = ++remoting.MessageWindowManager.nextId_; | 35 var id = ++remoting.MessageWindowManager.nextId_; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 100 } |
103 | 101 |
104 messageWindow.handleResult(result); | 102 messageWindow.handleResult(result); |
105 messageWindow.close(); | 103 messageWindow.close(); |
106 } | 104 } |
107 }; | 105 }; |
108 | 106 |
109 | 107 |
110 window.addEventListener('message', remoting.MessageWindowManager.onMessage_, | 108 window.addEventListener('message', remoting.MessageWindowManager.onMessage_, |
111 false); | 109 false); |
OLD | NEW |