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

Side by Side 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: Minor cleanups 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 $('fontSettingsCustomizeFontsButton').onclick = function(event) { 58 $('fontSettingsCustomizeFontsButton').onclick = function(event) {
59 OptionsPage.navigateToPage('fonts'); 59 OptionsPage.navigateToPage('fonts');
60 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); 60 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']);
61 }; 61 };
62 $('defaultFontSize').onchange = function(event) { 62 $('defaultFontSize').onchange = function(event) {
63 chrome.send('defaultFontSizeAction', 63 chrome.send('defaultFontSizeAction',
64 [String(event.target.options[event.target.selectedIndex].value)]); 64 [String(event.target.options[event.target.selectedIndex].value)]);
65 }; 65 };
66 $('defaultZoomFactor').onchange = function(event) {
67 chrome.send('defaultZoomFactorAction',
68 [String(event.target.options[event.target.selectedIndex].value)]);
69 };
70
66 $('language-button').onclick = function(event) { 71 $('language-button').onclick = function(event) {
67 OptionsPage.navigateToPage('languages'); 72 OptionsPage.navigateToPage('languages');
68 chrome.send('coreOptionsUserMetricsAction', 73 chrome.send('coreOptionsUserMetricsAction',
69 ['Options_LanuageAndSpellCheckSettings']); 74 ['Options_LanuageAndSpellCheckSettings']);
70 }; 75 };
71 76
72 if (cr.isWindows || cr.isMac) { 77 if (cr.isWindows || cr.isMac) {
73 $('certificatesManageButton').onclick = function(event) { 78 $('certificatesManageButton').onclick = function(event) {
74 chrome.send('showManageSSLCertificates'); 79 chrome.send('showManageSSLCertificates');
75 }; 80 };
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // Add/Select Custom Option in the font size label list. 169 // Add/Select Custom Option in the font size label list.
165 if (!$('Custom')) { 170 if (!$('Custom')) {
166 var option = new Option(localStrings.getString('fontSizeLabelCustom'), 171 var option = new Option(localStrings.getString('fontSizeLabelCustom'),
167 -1, false, true); 172 -1, false, true);
168 option.setAttribute("id", "Custom"); 173 option.setAttribute("id", "Custom");
169 selectCtl.add(option); 174 selectCtl.add(option);
170 } 175 }
171 $('Custom').selected = true; 176 $('Custom').selected = true;
172 }; 177 };
173 178
179 AdvancedOptions.SetupPageZoomSelector = function(items) {
James Hawkins 2011/11/15 18:35:51 Document the method and |items|.
csilv 2011/11/19 00:17:45 Done.
180 var element = $('defaultZoomFactor');
181
182 // Remove any existing content.
183 element.textContent = '';
184
185 // Insert new child nodes into select element.
186 var value, title, selected;
187 for (var i = 0; i < items.length; i++) {
188 title = items[i][0];
189 value = items[i][1];
190 selected = items[i][2];
191 element.appendChild(new Option(title, value, false, selected));
192 }
193 };
194
174 // Set the enabled state for the autoOpenFileTypesResetToDefault button. 195 // Set the enabled state for the autoOpenFileTypesResetToDefault button.
175 AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) { 196 AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) {
176 if (!cr.isChromeOS) { 197 if (!cr.isChromeOS) {
177 $('autoOpenFileTypesResetToDefault').disabled = disabled; 198 $('autoOpenFileTypesResetToDefault').disabled = disabled;
178 199
179 if (disabled) 200 if (disabled)
180 $('auto-open-file-types-label').classList.add('disabled'); 201 $('auto-open-file-types-label').classList.add('disabled');
181 else 202 else
182 $('auto-open-file-types-label').classList.remove('disabled'); 203 $('auto-open-file-types-label').classList.remove('disabled');
183 } 204 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 proxySectionElm.parentNode.removeChild(proxySectionElm); 249 proxySectionElm.parentNode.removeChild(proxySectionElm);
229 } 250 }
230 }; 251 };
231 252
232 // Export 253 // Export
233 return { 254 return {
234 AdvancedOptions: AdvancedOptions 255 AdvancedOptions: AdvancedOptions
235 }; 256 };
236 257
237 }); 258 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698