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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 */ | 59 */ |
60 remoting.MessageWindowManager.closeAllMessageWindows = function() { | 60 remoting.MessageWindowManager.closeAllMessageWindows = function() { |
61 /** @type {Array.<remoting.MessageWindow>} */ | 61 /** @type {Array.<remoting.MessageWindow>} */ |
62 var windows = []; | 62 var windows = []; |
63 // Make a list of the windows to close. | 63 // Make a list of the windows to close. |
64 // We don't delete the window directly in this loop because close() can | 64 // We don't delete the window directly in this loop because close() can |
65 // call deleteMessageWindow which will update messageWindows_. | 65 // call deleteMessageWindow which will update messageWindows_. |
66 for (var win_id in remoting.MessageWindowManager.messageWindows_) { | 66 for (var win_id in remoting.MessageWindowManager.messageWindows_) { |
67 /** @type {remoting.MessageWindow} */ | 67 /** @type {remoting.MessageWindow} */ |
68 var win = remoting.MessageWindowManager.getMessageWindow( | 68 var win = remoting.MessageWindowManager.getMessageWindow( |
69 /** @type {number} */(win_id)); | 69 parseInt(win_id, 10)); |
70 base.debug.assert(win != null); | 70 base.debug.assert(win != null); |
71 windows.push(win); | 71 windows.push(win); |
72 } | 72 } |
73 for (var i = 0; i < windows.length; i++) { | 73 for (var i = 0; i < windows.length; i++) { |
74 /** @type {remoting.MessageWindow} */(windows[i]).close(); | 74 /** @type {remoting.MessageWindow} */(windows[i]).close(); |
75 } | 75 } |
76 }; | 76 }; |
77 | 77 |
78 /** | 78 /** |
79 * Dispatch a message box result to the appropriate callback. | 79 * Dispatch a message box result to the appropriate callback. |
(...skipping 22 matching lines...) Expand all Loading... |
102 } | 102 } |
103 | 103 |
104 messageWindow.handleResult(result); | 104 messageWindow.handleResult(result); |
105 messageWindow.close(); | 105 messageWindow.close(); |
106 } | 106 } |
107 }; | 107 }; |
108 | 108 |
109 | 109 |
110 window.addEventListener('message', remoting.MessageWindowManager.onMessage_, | 110 window.addEventListener('message', remoting.MessageWindowManager.onMessage_, |
111 false); | 111 false); |
OLD | NEW |