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

Unified Diff: chrome/browser/resources/settings/appearance_page/appearance_page.js

Issue 2422603003: MD Settings: handle zoom as floats to fix ghost zoom level issue (Closed)
Patch Set: todo Created 4 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
Index: chrome/browser/resources/settings/appearance_page/appearance_page.js
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.js b/chrome/browser/resources/settings/appearance_page/appearance_page.js
index e8bac2aaf030ae0cba4341dc42c4fdadd3c4c5c0..bde7e1c8e9b5e54768aabeb6f92cb1e6842cbc34 100644
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.js
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js
@@ -56,27 +56,28 @@ Polymer({
* List of options for the page zoom drop-down menu.
* @type {!DropdownMenuOptionList}
dpapad 2016/10/15 00:58:07 Type annotation no longer accurate. Should be !Arr
Dan Beam 2016/10/17 19:20:26 Done.
*/
- pageZoomOptions_: {
+ pageZoomLevels_: {
readOnly: true,
type: Array,
value: [
- {value: 25, name: '25%'},
- {value: 33, name: '33%'},
- {value: 50, name: '50%'},
- {value: 67, name: '67%'},
- {value: 75, name: '75%'},
- {value: 80, name: '80%'},
- {value: 90, name: '90%'},
- {value: 100, name: '100%'},
- {value: 110, name: '110%'},
- {value: 125, name: '125%'},
- {value: 150, name: '150%'},
- {value: 175, name: '175%'},
- {value: 200, name: '200%'},
- {value: 250, name: '250%'},
- {value: 300, name: '300%'},
- {value: 400, name: '400%'},
- {value: 500, name: '500%'},
+ // TODO(dbeam): get these dynamically from C++ instead.
+ 1 / 4,
+ 1 / 3,
michaelpg 2016/10/17 08:46:08 when it comes to repeating decimals, is this safe?
Dan Beam 2016/10/17 19:20:26 safe enough, yes https://cs.chromium.org/chromium/
michaelpg 2016/10/17 19:58:15 ok, that's good. what about the JS side? we popula
Dan Beam 2016/10/17 21:01:20 i understand your concerns. i think getting these
+ 1 / 2,
+ 2 / 3,
+ 3 / 4,
+ 4 / 5,
+ 9 / 10,
+ 1,
+ 11 / 10,
+ 5 / 4,
+ 3 / 2,
+ 7 / 4,
+ 2,
+ 5 / 2,
+ 3,
+ 4,
+ 5,
],
},
@@ -118,6 +119,14 @@ Polymer({
},
/**
+ * @param {number} zoom
+ * @return {number} A zoom easier read by users.
dpapad 2016/10/15 00:58:07 @private
michaelpg 2016/10/17 08:46:08 {string} maybe
Dan Beam 2016/10/17 19:20:26 Done.
Dan Beam 2016/10/17 19:20:26 it's not a string
+ */
+ formatZoom_: function(zoom) {
+ return Math.round(zoom * 100);
michaelpg 2016/10/17 08:46:08 return (zoom * 100).toFixed();
Dan Beam 2016/10/17 19:20:26 what's the functional difference? especially for
michaelpg 2016/10/17 19:58:14 toFixed returns a string. it's mathematically equi
+ },
+
+ /**
* @param {boolean} isNtp Whether to use the NTP as the home page.
* @param {string} homepage If not using NTP, use this URL.
* @return {string} The sub-label.

Powered by Google App Engine
This is Rietveld 408576698