Chromium Code Reviews| 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 5b7462bd9315bb65beb987e947d9e0919873dba2..5789801ebc1581c7caf8b11b8f39d0558ae662c0 100644 |
| --- a/chrome/browser/resources/settings/appearance_page/appearance_page.js |
| +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js |
| @@ -49,6 +49,9 @@ Polymer({ |
| value: function() { |
| return { |
| type: chrome.settingsPrivate.PrefType.NUMBER, |
| + /* Needed such that the pref can be initialized without unnecessarily |
| + * invoking chrome.settingsPrivate.setDefaultZoomPercent(). */ |
| + initialized: false, |
|
michaelpg
2016/10/11 03:47:33
We probably shouldn't "overload" this value more t
dpapad
2016/10/11 17:30:17
Done.
|
| }; |
| }, |
| }, |
| @@ -213,6 +216,14 @@ Polymer({ |
| // The |percent| may be undefined on startup. |
| if (percent === undefined) |
| return; |
| + |
| + if (!this.defaultZoomLevel_.initialized) { |
|
michaelpg
2016/10/11 03:47:33
Since we only use this here, I wouldn't be averse
dpapad
2016/10/11 17:30:17
What do you mean defining it only here? Here in th
michaelpg
2016/10/11 22:01:10
Oh, I was just saying, this is JS, we don't have t
dpapad
2016/10/11 22:05:54
Ah, got it now. Personally I don't prefer augmenti
|
| + // Simply mark this pref as initialized, no actual change was requested by |
| + // the user. |
| + this.defaultZoomLevel_.initialized = true; |
| + return; |
| + } |
| + |
| chrome.settingsPrivate.setDefaultZoomPercent(percent); |
| }, |