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

Unified Diff: Source/devtools/front_end/ResponsiveDesignView.js

Issue 306803004: DevTools: hide emulation bits that are available in responsive design toolbar from the drawer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/elements/OverridesView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ResponsiveDesignView.js
diff --git a/Source/devtools/front_end/ResponsiveDesignView.js b/Source/devtools/front_end/ResponsiveDesignView.js
index 1f770083e1fe18f7330221ba7b6a9932cc8610e9..4883275c38c87777eb39dbbb6a3acacaac5aa1ed 100644
--- a/Source/devtools/front_end/ResponsiveDesignView.js
+++ b/Source/devtools/front_end/ResponsiveDesignView.js
@@ -43,6 +43,11 @@ WebInspector.ResponsiveDesignView = function(inspectedPagePlaceholder)
WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this);
WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged, this._updateOverridesSupportOnDockSideChange, this);
WebInspector.settings.responsiveDesignMode.addChangeListener(this._responsiveDesignModeChanged, this);
+
+ WebInspector.overridesSupport.settings.emulateViewport.addChangeListener(this._maybeEnableResponsiveDesign, this);
+ WebInspector.overridesSupport.settings.emulateTouchEvents.addChangeListener(this._maybeEnableResponsiveDesign, this);
+ WebInspector.overridesSupport.settings.overrideDeviceResolution.addChangeListener(this._maybeEnableResponsiveDesign, this);
+
this._updateOverridesSupportOnDockSideChange();
};
@@ -52,6 +57,17 @@ WebInspector.ResponsiveDesignView.RulerWidth = 20;
WebInspector.ResponsiveDesignView.ToolbarHeight = 24;
WebInspector.ResponsiveDesignView.prototype = {
+ _maybeEnableResponsiveDesign: function()
+ {
+ if (this._enabled)
+ return;
+ if (WebInspector.overridesSupport.settings.emulateViewport.get() ||
+ WebInspector.overridesSupport.settings.emulateTouchEvents.get() ||
+ WebInspector.overridesSupport.settings.overrideDeviceResolution.get()) {
+ WebInspector.settings.responsiveDesignMode.set(true);
+ }
+ },
+
_responsiveDesignModeChanged: function()
{
if (WebInspector.dockController.dockSide() === WebInspector.DockController.State.Undocked) {
« no previous file with comments | « no previous file | Source/devtools/front_end/elements/OverridesView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698