| OLD | NEW |
| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 }; | 49 }; |
| 50 } | 50 } |
| 51 | 51 |
| 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) { | |
| 60 chrome.send('defaultZoomLevelAction', | |
| 61 [String(event.target.options[event.target.selectedIndex].value)]); | |
| 62 }; | |
| 63 $('defaultFontSize').onchange = function(event) { | 59 $('defaultFontSize').onchange = function(event) { |
| 64 chrome.send('defaultFontSizeAction', | 60 chrome.send('defaultFontSizeAction', |
| 65 [String(event.target.options[event.target.selectedIndex].value)]); | 61 [String(event.target.options[event.target.selectedIndex].value)]); |
| 66 }; | 62 }; |
| 67 | 63 |
| 68 if (cr.isWindows || cr.isMac) { | 64 if (cr.isWindows || cr.isMac) { |
| 69 $('certificatesManageButton').onclick = function(event) { | 65 $('certificatesManageButton').onclick = function(event) { |
| 70 chrome.send('showManageSSLCertificates'); | 66 chrome.send('showManageSSLCertificates'); |
| 71 }; | 67 }; |
| 72 } else { | 68 } else { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 154 } |
| 159 | 155 |
| 160 AdvancedOptions.SetMetricsReportingSettingVisibility = function(visible) { | 156 AdvancedOptions.SetMetricsReportingSettingVisibility = function(visible) { |
| 161 if (visible) { | 157 if (visible) { |
| 162 $('metricsReportingSetting').style.display = 'block'; | 158 $('metricsReportingSetting').style.display = 'block'; |
| 163 } else { | 159 } else { |
| 164 $('metricsReportingSetting').style.display = 'none'; | 160 $('metricsReportingSetting').style.display = 'none'; |
| 165 } | 161 } |
| 166 } | 162 } |
| 167 | 163 |
| 168 // Set the default zoom level selected item. | |
| 169 AdvancedOptions.SetDefaultZoomLevel = function(value) { | |
| 170 var selectCtl = $('defaultZoomLevel'); | |
| 171 for (var i = 0; i < selectCtl.options.length; i++) { | |
| 172 if (selectCtl.options[i].value == value) { | |
| 173 selectCtl.selectedIndex = i; | |
| 174 return; | |
| 175 } | |
| 176 } | |
| 177 selectCtl.selectedIndex = 4; // 100% | |
| 178 }; | |
| 179 | |
| 180 // Set the font size selected item. | 164 // Set the font size selected item. |
| 181 AdvancedOptions.SetFontSize = function(fixed_font_size_value, | 165 AdvancedOptions.SetFontSize = function(fixed_font_size_value, |
| 182 font_size_value) { | 166 font_size_value) { |
| 183 var selectCtl = $('defaultFontSize'); | 167 var selectCtl = $('defaultFontSize'); |
| 184 if (fixed_font_size_value == font_size_value) { | 168 if (fixed_font_size_value == font_size_value) { |
| 185 for (var i = 0; i < selectCtl.options.length; i++) { | 169 for (var i = 0; i < selectCtl.options.length; i++) { |
| 186 if (selectCtl.options[i].value == font_size_value) { | 170 if (selectCtl.options[i].value == font_size_value) { |
| 187 selectCtl.selectedIndex = i; | 171 selectCtl.selectedIndex = i; |
| 188 if ($('Custom')) | 172 if ($('Custom')) |
| 189 selectCtl.remove($('Custom').index); | 173 selectCtl.remove($('Custom').index); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 var proxySectionElm = $('remoting-section'); | 250 var proxySectionElm = $('remoting-section'); |
| 267 proxySectionElm.parentNode.removeChild(proxySectionElm); | 251 proxySectionElm.parentNode.removeChild(proxySectionElm); |
| 268 }; | 252 }; |
| 269 | 253 |
| 270 // Export | 254 // Export |
| 271 return { | 255 return { |
| 272 AdvancedOptions: AdvancedOptions | 256 AdvancedOptions: AdvancedOptions |
| 273 }; | 257 }; |
| 274 | 258 |
| 275 }); | 259 }); |
| OLD | NEW |