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 * @extends {WebInspector.App} | 7 * @extends {WebInspector.App} |
| 8 * @implements {WebInspector.ToolboxHost} |
8 */ | 9 */ |
9 WebInspector.AdvancedApp = function() | 10 WebInspector.AdvancedApp = function() |
10 { | 11 { |
11 WebInspector.App.call(this); | 12 WebInspector.App.call(this); |
12 if (WebInspector.overridesSupport.responsiveDesignAvailable()) { | 13 if (WebInspector.overridesSupport.responsiveDesignAvailable()) { |
13 this._toggleEmulationButton = new WebInspector.StatusBarButton(WebInspec
tor.UIString("Toggle device mode."), "emulation-status-bar-item"); | 14 this._toggleEmulationButton = new WebInspector.StatusBarButton(WebInspec
tor.UIString("Toggle device mode."), "emulation-status-bar-item"); |
14 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.emul
ationEnabled(); | 15 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.emul
ationEnabled(); |
15 this._toggleEmulationButton.addEventListener("click", this._toggleEmulat
ionEnabled, this); | 16 this._toggleEmulationButton.addEventListener("click", this._toggleEmulat
ionEnabled, this); |
16 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.EmulationStateChanged, this._emulationEnabledChanged, this); | 17 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.EmulationStateChanged, this._emulationEnabledChanged, this); |
17 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); | 18 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSup
port.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 86 |
86 if (this._toolboxWindow) | 87 if (this._toolboxWindow) |
87 return; | 88 return; |
88 | 89 |
89 var url = window.location.href.replace("devtools.html", "toolbox.html"); | 90 var url = window.location.href.replace("devtools.html", "toolbox.html"); |
90 this._toolboxWindow = window.open(url, undefined); | 91 this._toolboxWindow = window.open(url, undefined); |
91 }, | 92 }, |
92 | 93 |
93 /** | 94 /** |
94 * @param {!Document} toolboxDocument | 95 * @param {!Document} toolboxDocument |
| 96 * @override |
95 */ | 97 */ |
96 toolboxLoaded: function(toolboxDocument) | 98 toolboxLoaded: function(toolboxDocument) |
97 { | 99 { |
98 WebInspector.initializeUIUtils(toolboxDocument.defaultView); | 100 WebInspector.initializeUIUtils(toolboxDocument.defaultView); |
99 WebInspector.installComponentRootStyles(/** @type {!Element} */ (toolbox
Document.body)); | 101 WebInspector.installComponentRootStyles(/** @type {!Element} */ (toolbox
Document.body)); |
100 WebInspector.ContextMenu.installHandler(toolboxDocument); | 102 WebInspector.ContextMenu.installHandler(toolboxDocument); |
101 | 103 |
102 var rootView = new WebInspector.RootView(); | 104 var rootView = new WebInspector.RootView(); |
103 var inspectedPagePlaceholder = new WebInspector.InspectedPagePlaceholder
(); | 105 var inspectedPagePlaceholder = new WebInspector.InspectedPagePlaceholder
(); |
104 inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePlac
eholder.Events.Update, this._onSetInspectedPageBounds.bind(this, true)); | 106 inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePlac
eholder.Events.Update, this._onSetInspectedPageBounds.bind(this, true)); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 handleAction: function() | 295 handleAction: function() |
294 { | 296 { |
295 if (!WebInspector.overridesSupport.responsiveDesignAvailable()) | 297 if (!WebInspector.overridesSupport.responsiveDesignAvailable()) |
296 return false; | 298 return false; |
297 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) | 299 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) |
298 return false; | 300 return false; |
299 WebInspector.app._toggleEmulationEnabled(); | 301 WebInspector.app._toggleEmulationEnabled(); |
300 return true; | 302 return true; |
301 } | 303 } |
302 } | 304 } |
OLD | NEW |