| 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 */ | 7 */ |
| 8 WebInspector.Toolbox = function() | 8 WebInspector.Toolbox = function() |
| 9 { | 9 { |
| 10 if (!window.opener) | 10 if (!window.opener) |
| 11 return; | 11 return; |
| 12 | 12 |
| 13 var delegate = /** @type {!WebInspector.ToolboxDelegate} */ (window.opener.W
ebInspector["app"]); | 13 var delegate = /** @type {!WebInspector.ToolboxDelegate} */ (window.opener.W
ebInspector["app"]); |
| 14 | 14 |
| 15 WebInspector.initializeUIUtils(window); | 15 WebInspector.initializeUIUtils(window); |
| 16 WebInspector.zoomManager = new WebInspector.ZoomManager(window, delegate.ins
pectorFrontendHost()); | 16 WebInspector.zoomManager = new WebInspector.ZoomManager(window, delegate.ins
pectorFrontendHost()); |
| 17 WebInspector.ContextMenu.installHandler(document); | 17 WebInspector.ContextMenu.installHandler(document); |
| 18 WebInspector.installPortStyles(document); | |
| 19 | 18 |
| 20 var rootView = new WebInspector.RootView(); | 19 var rootView = new WebInspector.RootView(); |
| 21 delegate.toolboxLoaded(rootView.element); | 20 delegate.toolboxLoaded(rootView.element); |
| 22 rootView.attachToBody(); | 21 rootView.attachToBody(); |
| 23 } | 22 } |
| 24 | 23 |
| 25 // FIXME: This stub is invoked from the backend and should be removed | 24 // FIXME: This stub is invoked from the backend and should be removed |
| 26 // once we migrate to the "pull" model for extensions retrieval. | 25 // once we migrate to the "pull" model for extensions retrieval. |
| 27 WebInspector.addExtensions = function() {} | 26 WebInspector.addExtensions = function() {} |
| 28 | 27 |
| 29 function windowLoaded() | 28 function windowLoaded() |
| 30 { | 29 { |
| 31 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 30 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
| 32 new WebInspector.Toolbox(); | 31 new WebInspector.Toolbox(); |
| 33 } | 32 } |
| 34 | 33 |
| 35 if (document.readyState === "complete") | 34 if (document.readyState === "complete") |
| 36 new WebInspector.Toolbox(); | 35 new WebInspector.Toolbox(); |
| 37 else | 36 else |
| 38 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 37 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
| OLD | NEW |