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

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

Issue 23187005: [DevTools] Use device metrics emulation implemented in content. (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Another rebase Created 7 years, 2 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 | « Source/core/rendering/TextAutosizer.cpp ('k') | Source/web/InspectorClientImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/OverridesSupport.js
diff --git a/Source/devtools/front_end/OverridesSupport.js b/Source/devtools/front_end/OverridesSupport.js
index c8567380d719116e06d68bed7768d4e1d6962817..e77c5f4973cfdbd870009844ca440d738bca642a 100644
--- a/Source/devtools/front_end/OverridesSupport.js
+++ b/Source/devtools/front_end/OverridesSupport.js
@@ -34,6 +34,7 @@
WebInspector.OverridesSupport = function()
{
this._overridesActive = WebInspector.settings.enableOverridesOnStartup.get();
+ this._deviceMetricsOverridesActive = false;
this._updateAllOverrides();
WebInspector.settings.overrideUserAgent.addChangeListener(this._userAgentChanged, this);
@@ -346,8 +347,14 @@ WebInspector.OverridesSupport.prototype = {
_deviceMetricsChanged: function()
{
var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(this._overridesActive && WebInspector.settings.overrideDeviceMetrics.get() ? WebInspector.settings.deviceMetrics.get() : "");
- if (metrics.isValid())
+ if (metrics.isValid()) {
+ var active = metrics.width > 0 && metrics.height > 0;
PageAgent.setDeviceMetricsOverride(metrics.width, metrics.height, metrics.fontScaleFactor, WebInspector.settings.deviceFitWindow.get());
+ if (active != this._deviceMetricsOverridesActive) {
+ PageAgent.reload(false);
+ this._deviceMetricsOverridesActive = active;
+ }
+ }
},
_geolocationPositionChanged: function()
« no previous file with comments | « Source/core/rendering/TextAutosizer.cpp ('k') | Source/web/InspectorClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698