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