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

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

Issue 2488113002: MD Settings: [further] robustify default zoom level handling (Closed)
Patch Set: Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49f9fc1a5fdec41fe40e61283174fa23907823fa..cb443e15c4fd4da5950c63608b84ed8db7ae16c0 100644
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.js
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js
@@ -112,7 +112,15 @@ Polymer({
// TODO(dschuyler): Look into adding a listener for the
// default zoom percent.
chrome.settingsPrivate.getDefaultZoom(function(zoom) {
- this.$.zoomLevel.value = zoom;
+ assert(this.pageZoomLevels_.length == this.$.zoomLevel.options.length);
+ for (var i = 0; i < this.pageZoomLevels_.length; ++i) {
dpapad 2016/11/10 00:30:58 If we have to iterate over zoom levels, would it m
Dan Beam 2016/11/10 01:22:11 Done.
+ // See content::ZoomValuesEqual().
+ if (Math.abs(this.pageZoomLevels_[i] - zoom) <= 0.001) {
+ this.$.zoomLevel.selectedIndex = i;
+ return;
+ }
+ }
+ assertNotReached();
}.bind(this));
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698