| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Initialize AdvancedOptions page. | 24 // Initialize AdvancedOptions page. |
| 25 initializePage: function() { | 25 initializePage: function() { |
| 26 // Call base class implementation to starts preference initialization. | 26 // Call base class implementation to starts preference initialization. |
| 27 OptionsPage.prototype.initializePage.call(this); | 27 OptionsPage.prototype.initializePage.call(this); |
| 28 | 28 |
| 29 // Setup click handlers for buttons. | 29 // Setup click handlers for buttons. |
| 30 $('privacyContentSettingsButton').onclick = function(event) { | 30 $('privacyContentSettingsButton').onclick = function(event) { |
| 31 OptionsPage.showPageByName('content'); | 31 OptionsPage.showPageByName('content'); |
| 32 OptionsPage.showTab($('cookies-nav-tab')); | 32 OptionsPage.showTab($('cookies-nav-tab')); |
| 33 chrome.send('coreOptionsUserMetricsAction', |
| 34 ['Options_ContentSettings']); |
| 33 }; | 35 }; |
| 34 $('privacyClearDataButton').onclick = function(event) { | 36 $('privacyClearDataButton').onclick = function(event) { |
| 35 OptionsPage.showOverlay('clearBrowserDataOverlay'); | 37 OptionsPage.showOverlay('clearBrowserDataOverlay'); |
| 38 chrome.send('coreOptionsUserMetricsAction', ['Options_ClearData']); |
| 36 }; | 39 }; |
| 37 $('autoOpenFileTypesResetToDefault').onclick = function(event) { | 40 $('autoOpenFileTypesResetToDefault').onclick = function(event) { |
| 38 chrome.send('autoOpenFileTypesAction'); | 41 chrome.send('autoOpenFileTypesAction'); |
| 39 }; | 42 }; |
| 40 $('fontSettingsConfigureFontsOnlyButton').onclick = function(event) { | 43 $('fontSettingsConfigureFontsOnlyButton').onclick = function(event) { |
| 41 OptionsPage.showOverlay('fontSettingsOverlay'); | 44 OptionsPage.showOverlay('fontSettingsOverlay'); |
| 45 chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 if (!cr.isChromeOS) { | 48 if (!cr.isChromeOS) { |
| 45 $('proxiesConfigureButton').onclick = function(event) { | 49 $('proxiesConfigureButton').onclick = function(event) { |
| 46 chrome.send('showNetworkProxySettings'); | 50 chrome.send('showNetworkProxySettings'); |
| 47 }; | 51 }; |
| 48 $('certificatesManageButton').onclick = function(event) { | 52 $('certificatesManageButton').onclick = function(event) { |
| 49 chrome.send('showManageSSLCertificates'); | 53 chrome.send('showManageSSLCertificates'); |
| 50 }; | 54 }; |
| 51 $('downloadLocationBrowseButton').onclick = function(event) { | 55 $('downloadLocationBrowseButton').onclick = function(event) { |
| 52 chrome.send('selectDownloadLocation'); | 56 chrome.send('selectDownloadLocation'); |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 // Remove Windows-style accelerators from the Browse button label. | 59 // Remove Windows-style accelerators from the Browse button label. |
| 56 // TODO(csilv): Remove this after the accelerator has been removed from | 60 // TODO(csilv): Remove this after the accelerator has been removed from |
| 57 // the localized strings file, pending removal of old options window. | 61 // the localized strings file, pending removal of old options window. |
| 58 $('downloadLocationBrowseButton').textContent = | 62 $('downloadLocationBrowseButton').textContent = |
| 59 localStrings.getStringWithoutAccelerator( | 63 localStrings.getStringWithoutAccelerator( |
| 60 'downloadLocationBrowseButton'); | 64 'downloadLocationBrowseButton'); |
| 61 } else { | 65 } else { |
| 62 $('proxiesConfigureButton').onclick = function(event) { | 66 $('proxiesConfigureButton').onclick = function(event) { |
| 63 OptionsPage.showPageByName('proxy'); | 67 OptionsPage.showPageByName('proxy'); |
| 68 chrome.send('coreOptionsUserMetricsAction', |
| 69 ['Options_ShowProxySettings']); |
| 64 }; | 70 }; |
| 65 } | 71 } |
| 66 | 72 |
| 67 if (cr.isWindows) { | 73 if (cr.isWindows) { |
| 68 $('sslCheckRevocation').onclick = function(event) { | 74 $('sslCheckRevocation').onclick = function(event) { |
| 69 chrome.send('checkRevocationCheckboxAction', | 75 chrome.send('checkRevocationCheckboxAction', |
| 70 [String($('sslCheckRevocation').checked)]); | 76 [String($('sslCheckRevocation').checked)]); |
| 71 }; | 77 }; |
| 72 $('sslUseSSL2').onclick = function(event) { | 78 $('sslUseSSL2').onclick = function(event) { |
| 73 chrome.send('useSSL2CheckboxAction', | 79 chrome.send('useSSL2CheckboxAction', |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 AdvancedOptions.SetUseSSL2CheckboxState = function(checked) { | 116 AdvancedOptions.SetUseSSL2CheckboxState = function(checked) { |
| 111 $('sslUseSSL2').checked = checked; | 117 $('sslUseSSL2').checked = checked; |
| 112 }; | 118 }; |
| 113 | 119 |
| 114 // Export | 120 // Export |
| 115 return { | 121 return { |
| 116 AdvancedOptions: AdvancedOptions | 122 AdvancedOptions: AdvancedOptions |
| 117 }; | 123 }; |
| 118 | 124 |
| 119 }); | 125 }); |
| OLD | NEW |