Chromium Code Reviews| 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..ef7259db5d52944867b3cc8aa3acc8031ad5226f 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,39 @@ var OptionsPage = options.OptionsPage; |
| selectCtl.selectedIndex = 4; // 100% |
| }; |
| + // Set the font size selected item. |
| + AdvancedOptions.SetFontSize = function(fixed_font_size_value, |
| + font_size_value) { |
| + var selectCtl = $('defaultFontSize'); |
| + |
|
csilv
2010/12/22 20:56:53
This looks good. I would recommend changing it a
kmadhusu
2010/12/22 21:19:08
Done.
|
| + if (fixed_font_size_value != font_size_value) { |
| + AddOrSelectCustomOption(); |
| + 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; |
| + } |
| + } |
| + AddOrSelectCustomOption(); |
| + }; |
| + |
| + // Add/Select Custom Option in the font size label list. |
| + function AddOrSelectCustomOption() { |
| + var selectCtl = $('defaultFontSize'); |
| + if (!$('Custom')) { |
| + var option = new Option(localStrings.getString('fontSizeLabelCustom'), |
| + -1, false, true); |
| + option.setAttribute("id","Custom"); |
| + selectCtl.add(option); |
| + } |
| + $('Custom').selected = true; |
| + }; |
| + |
| // Set the download path. |
| AdvancedOptions.SetDownloadLocationPath = function(path) { |
| if (!cr.isChromeOS) |