OLD | NEW |
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...) Loading... |
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...) Loading... |
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, |
| 178 font_size_value) { |
| 179 var selectCtl = $('defaultFontSize'); |
| 180 if (fixed_font_size_value == font_size_value) { |
| 181 for (var i = 0; i < selectCtl.options.length; i++) { |
| 182 if (selectCtl.options[i].value == font_size_value) { |
| 183 selectCtl.selectedIndex = i; |
| 184 if ($('Custom')) |
| 185 selectCtl.remove($('Custom').index); |
| 186 return; |
| 187 } |
| 188 } |
| 189 } |
| 190 |
| 191 // Add/Select Custom Option in the font size label list. |
| 192 if (!$('Custom')) { |
| 193 var option = new Option(localStrings.getString('fontSizeLabelCustom'), |
| 194 -1, false, true); |
| 195 option.setAttribute("id", "Custom"); |
| 196 selectCtl.add(option); |
| 197 } |
| 198 $('Custom').selected = true; |
| 199 }; |
| 200 |
172 // Set the download path. | 201 // Set the download path. |
173 AdvancedOptions.SetDownloadLocationPath = function(path) { | 202 AdvancedOptions.SetDownloadLocationPath = function(path) { |
174 if (!cr.isChromeOS) | 203 if (!cr.isChromeOS) |
175 $('downloadLocationPath').value = path; | 204 $('downloadLocationPath').value = path; |
176 }; | 205 }; |
177 | 206 |
178 // Set the enabled state for the autoOpenFileTypesResetToDefault button. | 207 // Set the enabled state for the autoOpenFileTypesResetToDefault button. |
179 AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) { | 208 AdvancedOptions.SetAutoOpenFileTypesDisabledAttribute = function(disabled) { |
180 $('autoOpenFileTypesResetToDefault').disabled = disabled; | 209 $('autoOpenFileTypesResetToDefault').disabled = disabled; |
181 }; | 210 }; |
(...skipping 45 matching lines...) Loading... |
227 $('cloud-print-proxy-section').style.display = 'none'; | 256 $('cloud-print-proxy-section').style.display = 'none'; |
228 } | 257 } |
229 }; | 258 }; |
230 | 259 |
231 // Export | 260 // Export |
232 return { | 261 return { |
233 AdvancedOptions: AdvancedOptions | 262 AdvancedOptions: AdvancedOptions |
234 }; | 263 }; |
235 | 264 |
236 }); | 265 }); |
OLD | NEW |