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