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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('options', function() { 5 cr.define('options', function() {
6 6
7 var OptionsPage = options.OptionsPage; 7 var OptionsPage = options.OptionsPage;
8 8
9 // 9 //
10 // AdvancedOptions class 10 // AdvancedOptions class
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 $('autoOpenFileTypesResetToDefault').onclick = function(event) { 52 $('autoOpenFileTypesResetToDefault').onclick = function(event) {
53 chrome.send('autoOpenFileTypesAction'); 53 chrome.send('autoOpenFileTypesAction');
54 }; 54 };
55 $('fontSettingsCustomizeFontsButton').onclick = function(event) { 55 $('fontSettingsCustomizeFontsButton').onclick = function(event) {
56 OptionsPage.showPageByName('fontSettings'); 56 OptionsPage.showPageByName('fontSettings');
57 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); 57 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']);
58 }; 58 };
59 $('defaultZoomLevel').onchange = function(event) { 59 $('defaultZoomLevel').onchange = function(event) {
60 chrome.send('defaultZoomLevelAction', 60 chrome.send('defaultZoomLevelAction',
61 [String(event.target.options[event.target.selectedIndex].value)]); 61 [String(event.target.options[event.target.selectedIndex].value)]);
62 } 62 };
63 $('defaultFontSize').onchange = function(event) {
64 chrome.send('defaultFontSizeAction',
65 [String(event.target.options[event.target.selectedIndex].value)]);
66 };
63 67
64 if (cr.isWindows || cr.isMac) { 68 if (cr.isWindows || cr.isMac) {
65 $('certificatesManageButton').onclick = function(event) { 69 $('certificatesManageButton').onclick = function(event) {
66 chrome.send('showManageSSLCertificates'); 70 chrome.send('showManageSSLCertificates');
67 }; 71 };
68 } else { 72 } else {
69 $('certificatesManageButton').onclick = function(event) { 73 $('certificatesManageButton').onclick = function(event) {
70 OptionsPage.showPageByName('certificateManager'); 74 OptionsPage.showPageByName('certificateManager');
71 OptionsPage.showTab($('personal-certs-nav-tab')); 75 OptionsPage.showTab($('personal-certs-nav-tab'));
72 chrome.send('coreOptionsUserMetricsAction', 76 chrome.send('coreOptionsUserMetricsAction',
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 var selectCtl = $('defaultZoomLevel'); 166 var selectCtl = $('defaultZoomLevel');
163 for (var i = 0; i < selectCtl.options.length; i++) { 167 for (var i = 0; i < selectCtl.options.length; i++) {
164 if (selectCtl.options[i].value == value) { 168 if (selectCtl.options[i].value == value) {
165 selectCtl.selectedIndex = i; 169 selectCtl.selectedIndex = i;
166 return; 170 return;
167 } 171 }
168 } 172 }
169 selectCtl.selectedIndex = 4; // 100% 173 selectCtl.selectedIndex = 4; // 100%
170 }; 174 };
171 175
176 // Set the font size selected item.
177 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
178 font_size_value) {
179 var selectCtl = $('defaultFontSize');
180
181 if (fixed_font_size_value != font_size_value) {
182 if (!$('Custom')) {
183 var option = new Option(localStrings.getString('FontSizeLabelCustom'),
184 -1, false, true);
185 option.setAttribute("id","Custom");
186 selectCtl.add(option);
187 }
188 $('Custom').selected = true;
189 return;
190 }
191
192 for (var i = 0; i < selectCtl.options.length; i++) {
193 if (selectCtl.options[i].value == font_size_value) {
194 selectCtl.selectedIndex = i;
195 if ($('Custom'))
196 selectCtl.remove($('Custom').index);
197 return;
198 }
199 }
200 };
201
172 // Set the download path. 202 // Set the download path.
173 AdvancedOptions.SetDownloadLocationPath = function(path) { 203 AdvancedOptions.SetDownloadLocationPath = function(path) {
174 if (!cr.isChromeOS) 204 if (!cr.isChromeOS)
175 $('downloadLocationPath').value = path; 205 $('downloadLocationPath').value = path;
176 }; 206 };
177 207
178 // Set the enabled state for the autoOpenFileTypesResetToDefault button. 208 // Set the enabled state for the autoOpenFileTypesResetToDefault button.
179 AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) { 209 AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) {
180 $('autoOpenFileTypesResetToDefault').disabled = disabled; 210 $('autoOpenFileTypesResetToDefault').disabled = disabled;
181 }; 211 };
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 $('cloud-print-proxy-section').style.display = 'none'; 257 $('cloud-print-proxy-section').style.display = 'none';
228 } 258 }
229 }; 259 };
230 260
231 // Export 261 // Export
232 return { 262 return {
233 AdvancedOptions: AdvancedOptions 263 AdvancedOptions: AdvancedOptions
234 }; 264 };
235 265
236 }); 266 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698