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"]); |
| 14 |
13 WebInspector.initializeUIUtils(window); | 15 WebInspector.initializeUIUtils(window); |
14 WebInspector.zoomManager = new WebInspector.ZoomManager(window, window.opene
r.InspectorFrontendHost); | 16 WebInspector.zoomManager = new WebInspector.ZoomManager(window, delegate.ins
pectorFrontendHost()); |
15 WebInspector.overridesSupport = window.opener.WebInspector.overridesSupport; | |
16 WebInspector.settings = window.opener.WebInspector.settings; | |
17 WebInspector.experimentsSettings = window.opener.WebInspector.experimentsSet
tings; | |
18 WebInspector.targetManager = window.opener.WebInspector.targetManager; | |
19 WebInspector.workspace = window.opener.WebInspector.workspace; | |
20 WebInspector.cssWorkspaceBinding = window.opener.WebInspector.cssWorkspaceBi
nding; | |
21 WebInspector.Revealer = window.opener.WebInspector.Revealer; | |
22 WebInspector.ContextMenu = window.opener.WebInspector.ContextMenu; | |
23 WebInspector.ContextMenu.installHandler(document); | 17 WebInspector.ContextMenu.installHandler(document); |
24 WebInspector.installPortStyles(document); | 18 WebInspector.installPortStyles(document); |
25 | 19 |
26 var delegate = /** @type {!WebInspector.ToolboxDelegate} */ (window.opener.W
ebInspector["app"]); | |
27 var rootView = new WebInspector.RootView(); | 20 var rootView = new WebInspector.RootView(); |
28 var inspectedPagePlaceholder = new WebInspector.InspectedPagePlaceholder(); | 21 delegate.toolboxLoaded(rootView.element); |
29 this._responsiveDesignView = new WebInspector.ResponsiveDesignView(inspected
PagePlaceholder); | |
30 this._responsiveDesignView.show(rootView.element); | |
31 rootView.attachToBody(); | 22 rootView.attachToBody(); |
32 delegate.toolboxLoaded(this._responsiveDesignView, inspectedPagePlaceholder)
; | |
33 } | 23 } |
34 | 24 |
35 // FIXME: This stub is invoked from the backend and should be removed | 25 // FIXME: This stub is invoked from the backend and should be removed |
36 // once we migrate to the "pull" model for extensions retrieval. | 26 // once we migrate to the "pull" model for extensions retrieval. |
37 WebInspector.addExtensions = function() {} | 27 WebInspector.addExtensions = function() {} |
38 | 28 |
39 function windowLoaded() | 29 function windowLoaded() |
40 { | 30 { |
41 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 31 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
42 new WebInspector.Toolbox(); | 32 new WebInspector.Toolbox(); |
43 } | 33 } |
44 | 34 |
45 if (document.readyState === "complete") | 35 if (document.readyState === "complete") |
46 new WebInspector.Toolbox(); | 36 new WebInspector.Toolbox(); |
47 else | 37 else |
48 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 38 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
OLD | NEW |