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

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

Issue 212103004: [DevTools] Show device screen size in DIPs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tests Created 6 years, 9 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/devtools/front_end/OverridesView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/Settings.js
diff --git a/Source/devtools/front_end/Settings.js b/Source/devtools/front_end/Settings.js
index 9e820cf3762e3d58de194443ee7f6a97419a321e..0593fbb08a1f299e91669c119ac92edb859160ee 100644
--- a/Source/devtools/front_end/Settings.js
+++ b/Source/devtools/front_end/Settings.js
@@ -483,7 +483,7 @@ WebInspector.VersionController = function()
{
}
-WebInspector.VersionController.currentVersion = 7;
+WebInspector.VersionController.currentVersion = 8;
WebInspector.VersionController.prototype = {
updateVersion: function()
@@ -646,6 +646,30 @@ WebInspector.VersionController.prototype = {
}
},
+ _updateVersionFrom7To8: function()
+ {
+ var settingName = "deviceMetrics";
+ if (!window.localStorage || !(settingName in window.localStorage))
+ return;
+ var setting = WebInspector.settings.createSetting(settingName, undefined);
+ var value = setting.get();
+ if (!value)
+ return;
+
+ var components = value.split("x");
+ if (components.length >= 3) {
+ var width = parseInt(components[0], 10);
+ var height = parseInt(components[1], 10);
+ var deviceScaleFactor = parseFloat(components[2]);
+ if (deviceScaleFactor) {
+ components[0] = "" + Math.round(width / deviceScaleFactor);
+ components[1] = "" + Math.round(height / deviceScaleFactor);
+ }
+ }
+ value = components.join("x");
+ setting.set(value);
+ },
+
/**
* @param {!WebInspector.Setting} breakpointsSetting
* @param {number} maxBreakpointsCount
« no previous file with comments | « Source/devtools/front_end/OverridesView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698