Chromium Code Reviews| Index: Source/devtools/front_end/OverridesSupport.js |
| diff --git a/Source/devtools/front_end/OverridesSupport.js b/Source/devtools/front_end/OverridesSupport.js |
| index b2af92c844a2ef62b9a01b0b44043b5664465fb4..ea47715db5b1351751195024eac291322d358df8 100644 |
| --- a/Source/devtools/front_end/OverridesSupport.js |
| +++ b/Source/devtools/front_end/OverridesSupport.js |
| @@ -67,15 +67,13 @@ WebInspector.OverridesSupport.Events = { |
| * @param {number} height |
| * @param {number} deviceScaleFactor |
| * @param {boolean} textAutosizing |
| - * @param {boolean} useAndroidFontMetrics |
| */ |
| -WebInspector.OverridesSupport.DeviceMetrics = function(width, height, deviceScaleFactor, textAutosizing, useAndroidFontMetrics) |
| +WebInspector.OverridesSupport.DeviceMetrics = function(width, height, deviceScaleFactor, textAutosizing) |
| { |
| this.width = width; |
| this.height = height; |
| this.deviceScaleFactor = deviceScaleFactor; |
| this.textAutosizing = textAutosizing; |
| - this.useAndroidFontMetrics = useAndroidFontMetrics; |
| } |
| /** |
| @@ -87,24 +85,22 @@ WebInspector.OverridesSupport.DeviceMetrics.parseSetting = function(value) |
| var height = 0; |
| var deviceScaleFactor = 1; |
| var textAutosizing = false; |
| - var useAndroidFontMetrics = false; |
| if (value) { |
| var splitMetrics = value.split("x"); |
| - if (splitMetrics.length === 5) { |
| + if (splitMetrics.length === 4) { |
| width = parseInt(splitMetrics[0], 10); |
| height = parseInt(splitMetrics[1], 10); |
| deviceScaleFactor = parseFloat(splitMetrics[2]); |
| - useAndroidFontMetrics = splitMetrics[3] == 1; |
| - textAutosizing = splitMetrics[4] == 1; |
| + textAutosizing = splitMetrics[3] == 1; |
| } |
| } |
| - return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing, useAndroidFontMetrics); |
| + return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing); |
| } |
| /** |
| * @return {?WebInspector.OverridesSupport.DeviceMetrics} |
| */ |
| -WebInspector.OverridesSupport.DeviceMetrics.parseUserInput = function(widthString, heightString, deviceScaleFactorString, textAutosizing, useAndroidFontMetrics) |
| +WebInspector.OverridesSupport.DeviceMetrics.parseUserInput = function(widthString, heightString, deviceScaleFactorString, textAutosizing) |
| { |
| function isUserInputValid(value, isInteger) |
| { |
| @@ -127,7 +123,7 @@ WebInspector.OverridesSupport.DeviceMetrics.parseUserInput = function(widthStrin |
| var height = isHeightValid ? parseInt(heightString || "0", 10) : -1; |
| var deviceScaleFactor = isDeviceScaleFactorValid ? parseFloat(deviceScaleFactorString) : -1; |
| - return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing, useAndroidFontMetrics); |
| + return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing); |
| } |
| WebInspector.OverridesSupport.DeviceMetrics.prototype = { |
| @@ -164,14 +160,6 @@ WebInspector.OverridesSupport.DeviceMetrics.prototype = { |
| }, |
| /** |
| - * @return {boolean} |
| - */ |
| - isUseAndroidFontMetricsDisabled: function() |
| - { |
| - return !this.textAutosizing; |
| - }, |
| - |
| - /** |
| * @return {string} |
| */ |
| toSetting: function() |
| @@ -179,7 +167,7 @@ WebInspector.OverridesSupport.DeviceMetrics.prototype = { |
| if (!this.isValid()) |
| return ""; |
| - return this.width && this.height ? this.width + "x" + this.height + "x" + this.deviceScaleFactor + "x" + (this.useAndroidFontMetrics ? "1" : "0") + "x" + (this.textAutosizing ? "1" : "0") : ""; |
| + return this.width && this.height ? this.width + "x" + this.height + "x" + this.deviceScaleFactor + "x" + (this.textAutosizing ? "1" : "0") : ""; |
| }, |
| /** |
| @@ -209,17 +197,17 @@ WebInspector.OverridesSupport.DeviceMetrics.prototype = { |
| /** |
| * Compute the font scale factor. |
| * |
| - * Android uses a device scale adjustment for fonts used in text autosizing for improved |
| - * legibility. This function computes this adjusted value if useAndroidFontMetrics is true. |
| + * Chromium on mobile uses a device scale adjustment for fonts used in text autosizing for |
|
skobes
2013/11/20 20:06:41
I would leave this comment as "Android", since it
|
| + * improved legibility. This function computes this adjusted value for text autosizing. |
| * |
| * For a description of the Android device scale adjustment algorithm, see: |
| * chrome/browser/chrome_content_browser_client.cc, GetFontScaleMultiplier(...) |
| * |
| - * @return {number} font scale factor for Android if useAndroidFontMetrics, or 1. |
| + * @return {number} font scale factor. |
| */ |
| fontScaleFactor: function() |
| { |
| - if (this.useAndroidFontMetrics && this.isValid()) { |
| + if (this.isValid()) { |
| var minWidth = Math.min(this.width, this.height) / this.deviceScaleFactor; |
| var kMinFSM = 1.05; |