OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 $('privacyClearDataButton').hidden = OptionsPage.isSettingsApp(); | 266 $('privacyClearDataButton').hidden = OptionsPage.isSettingsApp(); |
267 // 'metricsReportingEnabled' element is only present on Chrome branded | 267 // 'metricsReportingEnabled' element is only present on Chrome branded |
268 // builds, and the 'metricsReportingCheckboxAction' message is only | 268 // builds, and the 'metricsReportingCheckboxAction' message is only |
269 // handled on ChromeOS. | 269 // handled on ChromeOS. |
270 if ($('metricsReportingEnabled') && cr.isChromeOS) { | 270 if ($('metricsReportingEnabled') && cr.isChromeOS) { |
271 $('metricsReportingEnabled').onclick = function(event) { | 271 $('metricsReportingEnabled').onclick = function(event) { |
272 chrome.send('metricsReportingCheckboxAction', | 272 chrome.send('metricsReportingCheckboxAction', |
273 [String(event.currentTarget.checked)]); | 273 [String(event.currentTarget.checked)]); |
274 }; | 274 }; |
275 } | 275 } |
| 276 // The safe browsing download feedback setting requires special handling. |
| 277 // The pref is actually an enum, which needs to be mapped to a boolean. |
| 278 $('safe-browsing-download-feedback-enabled').checked = |
| 279 loadTimeData.getBoolean('sbDownloadFeedbackEnabled'); |
| 280 $('safe-browsing-download-feedback-enabled').onclick = function(event) { |
| 281 chrome.send( |
| 282 'downloadFeedbackStatusChanged', |
| 283 [Boolean($('safe-browsing-download-feedback-enabled').checked)]); |
| 284 }; |
276 | 285 |
277 // Bluetooth (CrOS only). | 286 // Bluetooth (CrOS only). |
278 if (cr.isChromeOS) { | 287 if (cr.isChromeOS) { |
279 options.system.bluetooth.BluetoothDeviceList.decorate( | 288 options.system.bluetooth.BluetoothDeviceList.decorate( |
280 $('bluetooth-paired-devices-list')); | 289 $('bluetooth-paired-devices-list')); |
281 | 290 |
282 $('bluetooth-add-device').onclick = | 291 $('bluetooth-add-device').onclick = |
283 this.handleAddBluetoothDevice_.bind(this); | 292 this.handleAddBluetoothDevice_.bind(this); |
284 | 293 |
285 $('enable-bluetooth').onchange = function(event) { | 294 $('enable-bluetooth').onchange = function(event) { |
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 BrowserOptions.getLoggedInUsername = function() { | 1618 BrowserOptions.getLoggedInUsername = function() { |
1610 return BrowserOptions.getInstance().username_; | 1619 return BrowserOptions.getInstance().username_; |
1611 }; | 1620 }; |
1612 } | 1621 } |
1613 | 1622 |
1614 // Export | 1623 // Export |
1615 return { | 1624 return { |
1616 BrowserOptions: BrowserOptions | 1625 BrowserOptions: BrowserOptions |
1617 }; | 1626 }; |
1618 }); | 1627 }); |
OLD | NEW |