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 */ | 8 */ |
9 WebInspector.AdvancedApp = function() | 9 WebInspector.AdvancedApp = function() |
10 { | 10 { |
11 WebInspector.App.call(this); | 11 WebInspector.App.call(this); |
12 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve
nts.BeforeDockSideChanged, this._openToolboxWindow, this); | 12 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve
nts.BeforeDockSideChanged, this._openToolboxWindow, this); |
13 | 13 |
14 if (!WebInspector.experimentsSettings.responsiveDesign.isEnabled()) | 14 if (!WebInspector.experimentsSettings.responsiveDesign.isEnabled()) |
15 return; | 15 return; |
16 | 16 |
17 this._toggleResponsiveDesignButton = new WebInspector.StatusBarButton(WebIns
pector.UIString("Responsive design and mobile emulation."), "responsive-design-s
tatus-bar-item"); | 17 this._toggleEmulationButton = new WebInspector.StatusBarButton(WebInspector.
UIString("Responsive design and mobile emulation."), "responsive-design-status-b
ar-item"); |
18 this._toggleResponsiveDesignButton.toggled = WebInspector.settings.responsiv
eDesignEnabled.get(); | 18 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.settings
.emulationEnabled.get(); |
19 this._toggleResponsiveDesignButton.addEventListener("click", this._toggleRes
ponsiveDesign, this); | 19 this._toggleEmulationButton.addEventListener("click", this._toggleEmulationE
nabled, this); |
20 WebInspector.settings.responsiveDesignEnabled.addChangeListener(this._respon
siveDesignEnabledChanged, this); | 20 WebInspector.overridesSupport.settings.emulationEnabled.addChangeListener(th
is._emulationEnabledChanged, this); |
21 }; | 21 }; |
22 | 22 |
23 WebInspector.AdvancedApp.prototype = { | 23 WebInspector.AdvancedApp.prototype = { |
24 _toggleResponsiveDesign: function() | 24 _toggleEmulationEnabled: function() |
25 { | 25 { |
26 WebInspector.settings.responsiveDesignEnabled.set(!this._toggleResponsiv
eDesignButton.toggled); | 26 WebInspector.overridesSupport.settings.emulationEnabled.set(!this._toggl
eEmulationButton.toggled); |
27 }, | 27 }, |
28 | 28 |
29 _responsiveDesignEnabledChanged: function() | 29 _emulationEnabledChanged: function() |
30 { | 30 { |
31 this._toggleResponsiveDesignButton.toggled = WebInspector.settings.respo
nsiveDesignEnabled.get(); | 31 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.sett
ings.emulationEnabled.get(); |
32 }, | 32 }, |
33 | 33 |
34 createRootView: function() | 34 createRootView: function() |
35 { | 35 { |
36 var rootView = new WebInspector.RootView(); | 36 var rootView = new WebInspector.RootView(); |
37 | 37 |
38 this._rootSplitView = new WebInspector.SplitView(false, true, WebInspect
or.dockController.canDock() ? "InspectorView.splitViewState" : "InspectorView.du
mmySplitViewState", 300, 300); | 38 this._rootSplitView = new WebInspector.SplitView(false, true, WebInspect
or.dockController.canDock() ? "InspectorView.splitViewState" : "InspectorView.du
mmySplitViewState", 300, 300); |
39 this._rootSplitView.show(rootView.element); | 39 this._rootSplitView.show(rootView.element); |
40 | 40 |
41 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); | 41 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 WebInspector.AdvancedApp.ResponsiveDesignButtonProvider.prototype = { | 187 WebInspector.AdvancedApp.ResponsiveDesignButtonProvider.prototype = { |
188 /** | 188 /** |
189 * @return {?WebInspector.StatusBarButton} | 189 * @return {?WebInspector.StatusBarButton} |
190 */ | 190 */ |
191 button: function() | 191 button: function() |
192 { | 192 { |
193 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) | 193 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) |
194 return null; | 194 return null; |
195 return /** @type {!WebInspector.AdvancedApp} */ (WebInspector.app)._togg
leResponsiveDesignButton || null; | 195 return /** @type {!WebInspector.AdvancedApp} */ (WebInspector.app)._togg
leEmulationButton || null; |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 /** | 199 /** |
200 * @constructor | 200 * @constructor |
201 */ | 201 */ |
202 WebInspector.Toolbox = function() | 202 WebInspector.Toolbox = function() |
203 { | 203 { |
204 if (!window.opener) | 204 if (!window.opener) |
205 return; | 205 return; |
(...skipping 10 matching lines...) Expand all Loading... |
216 this._inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePl
aceholder.Events.Update, advancedApp._onSetInspectedPageBounds.bind(advancedApp,
true)); | 216 this._inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePl
aceholder.Events.Update, advancedApp._onSetInspectedPageBounds.bind(advancedApp,
true)); |
217 if (WebInspector.experimentsSettings.responsiveDesign.isEnabled()) { | 217 if (WebInspector.experimentsSettings.responsiveDesign.isEnabled()) { |
218 this._responsiveDesignView = new WebInspector.ResponsiveDesignView(this.
_inspectedPagePlaceholder); | 218 this._responsiveDesignView = new WebInspector.ResponsiveDesignView(this.
_inspectedPagePlaceholder); |
219 this._responsiveDesignView.show(rootView.element); | 219 this._responsiveDesignView.show(rootView.element); |
220 } else { | 220 } else { |
221 this._inspectedPagePlaceholder.show(rootView.element); | 221 this._inspectedPagePlaceholder.show(rootView.element); |
222 } | 222 } |
223 rootView.attachToBody(); | 223 rootView.attachToBody(); |
224 advancedApp._toolboxLoaded(this); | 224 advancedApp._toolboxLoaded(this); |
225 } | 225 } |
OLD | NEW |