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

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

Issue 6057003: DOMUI Settings: UTH: Fix up the 'Web Content' section. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 10 years 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
« no previous file with comments | « chrome/browser/resources/options/advanced_options.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « chrome/browser/resources/options/advanced_options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698