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 09a8aad321d529bf652ebfe29e5aec79b0fcb8ba..9f7f4877152d40cdcbb7eca6b62d32df7d661816 100644 |
| --- a/chrome/browser/resources/settings/appearance_page/appearance_page.js |
| +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js |
| @@ -30,6 +30,14 @@ Polymer({ |
| }, |
| /** |
| + * Preferences state. |
| + */ |
| + prefs: { |
| + type: Object, |
| + notify: true, |
| + }, |
| + |
| + /** |
| * @private |
| */ |
| allowResetTheme_: { |
| @@ -39,10 +47,21 @@ Polymer({ |
| }, |
| /** |
| + * @private |
| + */ |
| + defaultZoomLevel_: { |
| + notify: true, |
| + type: Object, |
| + value: function() { |
| + return {value: undefined}; |
| + }, |
| + }, |
| + |
| + /** |
| * List of options for the font size drop-down menu. |
| * The order of entries in this array matches the |
| * prefs.browser.clear_data.time_period.value enum. |
| - * @private {!Array<!Array<{0: number, 1: string}>>} |
| + * @private {!Array<!Array<number, string>>} |
| */ |
| fontSizeOptions_: { |
| readOnly: true, |
| @@ -57,14 +76,49 @@ Polymer({ |
| ]; |
| }, |
| }, |
| + |
| + /** |
| + * List of options for the page zoom drop-down menu. |
| + * The order of entries in this array matches the |
| + * prefs.browser.clear_data.time_period.value enum. |
|
michaelpg
2015/11/09 23:59:45
wat
dschuyler
2015/11/10 20:03:39
The same could apply to the fontSizeOptions_ above
|
| + * @private {!Array<!Array<number, string>>} |
| + */ |
| + pageZoomOptions_: { |
| + readOnly: true, |
| + type: Array, |
| + value: [ |
| + [25, '25%'], |
| + [33, '33%'], |
| + [50, '50%'], |
| + [67, '67%'], |
| + [75, '75%'], |
| + [90, '90%'], |
| + [100, '100%'], |
| + [110, '110%'], |
| + [125, '125%'], |
| + [150, '150%'], |
| + [175, '175%'], |
| + [200, '200%'], |
| + [300, '300%'], |
| + [400, '400%'], |
| + [500, '500%'], |
| + ], |
| + }, |
| }, |
| behaviors: [ |
| I18nBehavior, |
| ], |
| + observers: [ |
| + 'zoomLevelChanged_(defaultZoomLevel_.value)', |
| + ], |
| + |
| ready: function() { |
| this.$.defaultFontSize.menuOptions = this.fontSizeOptions_; |
| + this.$.pageZoom.menuOptions = this.pageZoomOptions_; |
| + chrome.settingsPrivate.getDefaultZoomPercent( |
| + this.zoomPrefChanged_.bind(this)); |
| }, |
| /** @override */ |
| @@ -91,6 +145,11 @@ Polymer({ |
| }, |
| /** @private */ |
| + onCustomizeFontsTap_: function() { |
|
michaelpg
2015/11/09 23:59:45
wat
dschuyler
2015/11/10 20:03:39
I seem to have had some trouble merging code.
Don
Dan Beam
2015/11/10 22:21:26
the review tools, turns out, can still be used to
|
| + this.$.pages.setSubpageChain(['appearance-fonts']); |
| + }, |
| + |
| + /** @private */ |
| openThemesGallery_: function() { |
| window.open(loadTimeData.getString('themesGalleryUrl')); |
| }, |
| @@ -99,4 +158,15 @@ Polymer({ |
| resetTheme_: function() { |
| chrome.send('resetTheme'); |
| }, |
| + |
| + zoomPrefChanged_: function(percent) { |
| + this.set('defaultZoomLevel_.value', percent); |
| + }, |
| + |
| + zoomLevelChanged_: function(percent) { |
| + // The |percent| may be undefined on startup. |
| + if (percent === undefined) |
| + return; |
| + chrome.settingsPrivate.setDefaultZoomPercent(percent); |
| + }, |
| }); |