Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Side by Side Diff: Source/devtools/front_end/main/AdvancedApp.js

Issue 347583003: DevTools: add emulation toggle button and splash screen. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/inspector.css ('k') | Source/devtools/front_end/overrides.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 this._toggleEmulationButton = new WebInspector.StatusBarButton(WebInspector. UIString("Toggle emulation enabled."), "responsive-design-status-bar-item");
15 return;
16
17 this._toggleEmulationButton = new WebInspector.StatusBarButton(WebInspector. UIString("Responsive design and mobile emulation."), "responsive-design-status-b ar-item");
18 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.settings .emulationEnabled.get(); 15 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.settings .emulationEnabled.get();
19 this._toggleEmulationButton.addEventListener("click", this._toggleEmulationE nabled, this); 16 this._toggleEmulationButton.addEventListener("click", this._toggleEmulationE nabled, this);
20 WebInspector.overridesSupport.settings.emulationEnabled.addChangeListener(th is._emulationEnabledChanged, this); 17 WebInspector.overridesSupport.settings.emulationEnabled.addChangeListener(th is._emulationEnabledChanged, this);
21 }; 18 };
22 19
23 WebInspector.AdvancedApp.prototype = { 20 WebInspector.AdvancedApp.prototype = {
24 _toggleEmulationEnabled: function() 21 _toggleEmulationEnabled: function()
25 { 22 {
26 WebInspector.overridesSupport.settings.emulationEnabled.set(!this._toggl eEmulationButton.toggled); 23 WebInspector.overridesSupport.settings.emulationEnabled.set(!this._toggl eEmulationButton.toggled);
27 }, 24 },
28 25
29 _emulationEnabledChanged: function() 26 _emulationEnabledChanged: function()
30 { 27 {
31 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.sett ings.emulationEnabled.get(); 28 this._toggleEmulationButton.toggled = WebInspector.overridesSupport.sett ings.emulationEnabled.get();
29 if (!WebInspector.experimentsSettings.responsiveDesign.isEnabled() && We bInspector.overridesSupport.settings.emulationEnabled.get())
30 WebInspector.inspectorView.showViewInDrawer("emulation", true);
32 }, 31 },
33 32
34 createRootView: function() 33 createRootView: function()
35 { 34 {
36 var rootView = new WebInspector.RootView(); 35 var rootView = new WebInspector.RootView();
37 36
38 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);
39 this._rootSplitView.show(rootView.element); 38 this._rootSplitView.show(rootView.element);
40 39
41 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); 40 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement());
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 this._inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePl aceholder.Events.Update, advancedApp._onSetInspectedPageBounds.bind(advancedApp, true)); 215 this._inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePl aceholder.Events.Update, advancedApp._onSetInspectedPageBounds.bind(advancedApp, true));
217 if (WebInspector.experimentsSettings.responsiveDesign.isEnabled()) { 216 if (WebInspector.experimentsSettings.responsiveDesign.isEnabled()) {
218 this._responsiveDesignView = new WebInspector.ResponsiveDesignView(this. _inspectedPagePlaceholder); 217 this._responsiveDesignView = new WebInspector.ResponsiveDesignView(this. _inspectedPagePlaceholder);
219 this._responsiveDesignView.show(rootView.element); 218 this._responsiveDesignView.show(rootView.element);
220 } else { 219 } else {
221 this._inspectedPagePlaceholder.show(rootView.element); 220 this._inspectedPagePlaceholder.show(rootView.element);
222 } 221 }
223 rootView.attachToBody(); 222 rootView.attachToBody();
224 advancedApp._toolboxLoaded(this); 223 advancedApp._toolboxLoaded(this);
225 } 224 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/inspector.css ('k') | Source/devtools/front_end/overrides.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698