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 | 12 |
13 if (!WebInspector.experimentsSettings.responsiveDesign.isEnabled()) | 13 if (!WebInspector.experimentsSettings.responsiveDesign.isEnabled()) |
14 return; | 14 return; |
15 | 15 |
16 this._toggleResponsiveDesignButton = new WebInspector.StatusBarButton(WebIns
pector.UIString("Responsive design mode."), "responsive-design-status-bar-item")
; | 16 this._toggleResponsiveDesignButton = new WebInspector.StatusBarButton(WebIns
pector.UIString("Responsive design mode."), "responsive-design-status-bar-item")
; |
17 this._toggleResponsiveDesignButton.toggled = WebInspector.settings.responsiv
eDesignMode.get(); | 17 this._toggleResponsiveDesignButton.toggled = WebInspector.settings.responsiv
eDesign.enabled.get(); |
18 this._toggleResponsiveDesignButton.addEventListener("click", this._toggleRes
ponsiveDesign, this); | 18 this._toggleResponsiveDesignButton.addEventListener("click", this._toggleRes
ponsiveDesign, this); |
19 WebInspector.settings.responsiveDesignMode.addChangeListener(this._responsiv
eDesignModeChanged, this); | 19 WebInspector.settings.responsiveDesign.enabled.addChangeListener(this._respo
nsiveDesignEnabledChanged, this); |
20 }; | 20 }; |
21 | 21 |
22 WebInspector.AdvancedApp.prototype = { | 22 WebInspector.AdvancedApp.prototype = { |
23 _toggleResponsiveDesign: function() | 23 _toggleResponsiveDesign: function() |
24 { | 24 { |
25 WebInspector.settings.responsiveDesignMode.set(!this._toggleResponsiveDe
signButton.toggled); | 25 WebInspector.settings.responsiveDesign.enabled.set(!this._toggleResponsi
veDesignButton.toggled); |
26 }, | 26 }, |
27 | 27 |
28 _responsiveDesignModeChanged: function() | 28 _responsiveDesignEnabledChanged: function() |
29 { | 29 { |
30 this._toggleResponsiveDesignButton.toggled = WebInspector.settings.respo
nsiveDesignMode.get(); | 30 this._toggleResponsiveDesignButton.toggled = WebInspector.settings.respo
nsiveDesign.enabled.get(); |
31 }, | 31 }, |
32 | 32 |
33 createRootView: function() | 33 createRootView: function() |
34 { | 34 { |
35 var rootView = new WebInspector.RootView(); | 35 var rootView = new WebInspector.RootView(); |
36 | 36 |
37 this._rootSplitView = new WebInspector.SplitView(false, true, WebInspect
or.dockController.canDock() ? "InspectorView.splitViewState" : "InspectorView.du
mmySplitViewState", 300, 300); | 37 this._rootSplitView = new WebInspector.SplitView(false, true, WebInspect
or.dockController.canDock() ? "InspectorView.splitViewState" : "InspectorView.du
mmySplitViewState", 300, 300); |
38 this._rootSplitView.show(rootView.element); | 38 this._rootSplitView.show(rootView.element); |
39 | 39 |
40 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); | 40 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 /** | 114 /** |
115 * @return {?WebInspector.StatusBarButton} | 115 * @return {?WebInspector.StatusBarButton} |
116 */ | 116 */ |
117 button: function() | 117 button: function() |
118 { | 118 { |
119 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) | 119 if (!(WebInspector.app instanceof WebInspector.AdvancedApp)) |
120 return null; | 120 return null; |
121 return /** @type {!WebInspector.AdvancedApp} */ (WebInspector.app)._togg
leResponsiveDesignButton || null; | 121 return /** @type {!WebInspector.AdvancedApp} */ (WebInspector.app)._togg
leResponsiveDesignButton || null; |
122 } | 122 } |
123 } | 123 } |
OLD | NEW |