| 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 /** |
| 6 * @constructor |
| 7 * @suppressGlobalPropertiesCheck |
| 8 */ |
| 9 WebInspector.Toolbox = function() |
| 10 { |
| 11 if (!window.opener) |
| 12 return; |
| 13 |
| 14 var host = /** @type {!WebInspector.ToolboxHost} */ (window.opener.WebInspec
tor["app"]); |
| 15 host.toolboxLoaded(document); |
| 16 } |
| 17 |
| 5 // FIXME: This stub is invoked from the backend and should be removed | 18 // FIXME: This stub is invoked from the backend and should be removed |
| 6 // once we migrate to the "pull" model for extensions retrieval. | 19 // once we migrate to the "pull" model for extensions retrieval. |
| 7 WebInspector = {}; | 20 WebInspector.addExtensions = function() {} |
| 8 WebInspector.addExtensions = function() {}; | |
| 9 | |
| 10 (function() | |
| 11 { | |
| 12 | 21 |
| 13 /** | 22 /** |
| 14 * @suppressGlobalPropertiesCheck | 23 * @suppressGlobalPropertiesCheck |
| 15 */ | |
| 16 function toolboxLoaded() | |
| 17 { | |
| 18 if (!window.opener) | |
| 19 return; | |
| 20 window.opener.WebInspector["app"]["toolboxLoaded"](document); | |
| 21 } | |
| 22 | |
| 23 /** | |
| 24 * @suppressGlobalPropertiesCheck | |
| 25 */ | 24 */ |
| 26 function windowLoaded() | 25 function windowLoaded() |
| 27 { | 26 { |
| 28 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 27 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
| 29 toolboxLoaded(); | 28 new WebInspector.Toolbox(); |
| 30 } | 29 } |
| 31 | 30 |
| 32 /** | 31 /** |
| 33 * @suppressGlobalPropertiesCheck | 32 * @suppressGlobalPropertiesCheck |
| 34 */ | 33 */ |
| 35 function initToolbox() | 34 function initToolbox() |
| 36 { | 35 { |
| 37 if (document.readyState === "complete") | 36 if (document.readyState === "complete") |
| 38 toolboxLoaded(); | 37 new WebInspector.Toolbox(); |
| 39 else | 38 else |
| 40 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 39 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
| 41 } | 40 } |
| 42 initToolbox(); | 41 initToolbox(); |
| 43 | |
| 44 })(); | |
| OLD | NEW |