Index: chrome/browser/resources/options/advanced_options.js |
diff --git a/chrome/browser/resources/options/advanced_options.js b/chrome/browser/resources/options/advanced_options.js |
index 051c3cf3d3d0db54e68838b1a9f342b0a33f56da..21269f27cb183665634efa8359b69149c6e3071d 100644 |
--- a/chrome/browser/resources/options/advanced_options.js |
+++ b/chrome/browser/resources/options/advanced_options.js |
@@ -59,7 +59,11 @@ var OptionsPage = options.OptionsPage; |
$('defaultZoomLevel').onchange = function(event) { |
chrome.send('defaultZoomLevelAction', |
[String(event.target.options[event.target.selectedIndex].value)]); |
- } |
+ }; |
+ $('defaultFontSize').onchange = function(event) { |
+ chrome.send('defaultFontSizeAction', |
+ [String(event.target.options[event.target.selectedIndex].value)]); |
+ }; |
if (cr.isWindows || cr.isMac) { |
$('certificatesManageButton').onclick = function(event) { |
@@ -169,6 +173,32 @@ var OptionsPage = options.OptionsPage; |
selectCtl.selectedIndex = 4; // 100% |
}; |
+ // Set the font size selected item. |
+ AdvancedOptions.SetFontSize = function(fixed_font_size_value, |
csilv
2010/12/22 02:35:27
It looks like this method only adds the custom opt
kmadhusu
2010/12/22 19:15:02
I am listening for "fixed_font_size_value" and "fo
csilv
2010/12/22 19:32:38
This method is also invoked when the pane is initi
|
+ font_size_value) { |
+ var selectCtl = $('defaultFontSize'); |
+ |
+ if (fixed_font_size_value != font_size_value) { |
+ if (!$('Custom')) { |
+ var option = new Option(localStrings.getString('FontSizeLabelCustom'), |
+ -1, false, true); |
+ option.setAttribute("id","Custom"); |
+ selectCtl.add(option); |
+ } |
+ $('Custom').selected = true; |
+ return; |
+ } |
+ |
+ for (var i = 0; i < selectCtl.options.length; i++) { |
+ if (selectCtl.options[i].value == font_size_value) { |
+ selectCtl.selectedIndex = i; |
+ if ($('Custom')) |
+ selectCtl.remove($('Custom').index); |
+ return; |
+ } |
+ } |
+ }; |
+ |
// Set the download path. |
AdvancedOptions.SetDownloadLocationPath = function(path) { |
if (!cr.isChromeOS) |