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

Unified Diff: chrome/browser/resources/options/advanced_options.js

Issue 8528011: Page zoom improvements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: One last(?) tweak. Created 9 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
Index: chrome/browser/resources/options/advanced_options.js
===================================================================
--- chrome/browser/resources/options/advanced_options.js (revision 110998)
+++ chrome/browser/resources/options/advanced_options.js (working copy)
@@ -63,6 +63,11 @@
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 @@
$('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) {

Powered by Google App Engine
This is Rietveld 408576698