| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @suppressGlobalPropertiesCheck | 7 * @suppressGlobalPropertiesCheck |
| 8 */ | 8 */ |
| 9 WebInspector.Toolbox = function() | 9 WebInspector.Toolbox = function() |
| 10 { | 10 { |
| 11 if (!window.opener) | 11 if (!window.opener) |
| 12 return; | 12 return; |
| 13 | 13 |
| 14 var delegate = /** @type {!WebInspector.ToolboxHost} */ (window.opener.WebIn
spector["app"]); | 14 var host = /** @type {!WebInspector.ToolboxHost} */ (window.opener.WebInspec
tor["app"]); |
| 15 | 15 host.toolboxLoaded(document); |
| 16 WebInspector.initializeUIUtils(window); | |
| 17 WebInspector.zoomManager = new WebInspector.ZoomManager(window, delegate.ins
pectorFrontendHost()); | |
| 18 WebInspector.ContextMenu.installHandler(document); | |
| 19 | |
| 20 var rootView = new WebInspector.RootView(); | |
| 21 delegate.toolboxLoaded(rootView.element); | |
| 22 rootView.attachToBody(); | |
| 23 } | 16 } |
| 24 | 17 |
| 25 // 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 |
| 26 // once we migrate to the "pull" model for extensions retrieval. | 19 // once we migrate to the "pull" model for extensions retrieval. |
| 27 WebInspector.addExtensions = function() {} | 20 WebInspector.addExtensions = function() {} |
| 28 | 21 |
| 29 /** | 22 /** |
| 30 * FIXME: Remove FIXME once http://crbug.com/425506 is fixed. | 23 * FIXME: Remove FIXME once http://crbug.com/425506 is fixed. |
| 31 * @suppressGlobalPropertiesCheck | 24 * @suppressGlobalPropertiesCheck |
| 32 */ | 25 */ |
| 33 function windowLoaded() | 26 function windowLoaded() |
| 34 { | 27 { |
| 35 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 28 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
| 36 new WebInspector.Toolbox(); | 29 new WebInspector.Toolbox(); |
| 37 } | 30 } |
| 38 | 31 |
| 39 /** | 32 /** |
| 40 * FIXME: Remove FIXME once http://crbug.com/425506 is fixed. | 33 * FIXME: Remove FIXME once http://crbug.com/425506 is fixed. |
| 41 * @suppressGlobalPropertiesCheck | 34 * @suppressGlobalPropertiesCheck |
| 42 */ | 35 */ |
| 43 function initToolbox() | 36 function initToolbox() |
| 44 { | 37 { |
| 45 if (document.readyState === "complete") | 38 if (document.readyState === "complete") |
| 46 new WebInspector.Toolbox(); | 39 new WebInspector.Toolbox(); |
| 47 else | 40 else |
| 48 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 41 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
| 49 } | 42 } |
| 50 initToolbox(); | 43 initToolbox(); |
| OLD | NEW |