diff options
Diffstat (limited to 'chrome/browser/resources/options/advanced_options.js')
-rw-r--r-- | chrome/browser/resources/options/advanced_options.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/resources/options/advanced_options.js b/chrome/browser/resources/options/advanced_options.js index d3bfbc6..fb1a809 100644 --- a/chrome/browser/resources/options/advanced_options.js +++ b/chrome/browser/resources/options/advanced_options.js @@ -63,6 +63,11 @@ var OptionsPage = options.OptionsPage; chrome.send('defaultFontSizeAction', [String(event.target.options[event.target.selectedIndex].value)]); }; + $('defaultZoomFactor').onchange = function(event) { + chrome.send('defaultZoomFactorAction', + [String(event.target.options[event.target.selectedIndex].value)]); + }; + $('language-button').onclick = function(event) { OptionsPage.navigateToPage('languages'); chrome.send('coreOptionsUserMetricsAction', @@ -171,6 +176,30 @@ var OptionsPage = options.OptionsPage; $('Custom').selected = true; }; + /** + * Populate the page zoom selector with values received from the caller. + * @param {Array} items An array of items to populate the selector. + * each object is an array with three elements as follows: + * 0: The title of the item (string). + * 1: The value of the item (number). + * 2: Whether the item should be selected (boolean). + */ + AdvancedOptions.SetupPageZoomSelector = function(items) { + var element = $('defaultZoomFactor'); + + // Remove any existing content. + element.textContent = ''; + + // Insert new child nodes into select element. + var value, title, selected; + for (var i = 0; i < items.length; i++) { + title = items[i][0]; + value = items[i][1]; + selected = items[i][2]; + element.appendChild(new Option(title, value, false, selected)); + } + }; + // Set the enabled state for the autoOpenFileTypesResetToDefault button. AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) { if (!cr.isChromeOS) { |