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 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; | 9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; |
10 | 10 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 $('privacyClearDataButton').hidden = OptionsPage.isSettingsApp(); | 341 $('privacyClearDataButton').hidden = OptionsPage.isSettingsApp(); |
342 // 'metricsReportingEnabled' element is only present on Chrome branded | 342 // 'metricsReportingEnabled' element is only present on Chrome branded |
343 // builds, and the 'metricsReportingCheckboxAction' message is only | 343 // builds, and the 'metricsReportingCheckboxAction' message is only |
344 // handled on ChromeOS. | 344 // handled on ChromeOS. |
345 if ($('metricsReportingEnabled') && cr.isChromeOS) { | 345 if ($('metricsReportingEnabled') && cr.isChromeOS) { |
346 $('metricsReportingEnabled').onclick = function(event) { | 346 $('metricsReportingEnabled').onclick = function(event) { |
347 chrome.send('metricsReportingCheckboxAction', | 347 chrome.send('metricsReportingCheckboxAction', |
348 [String(event.currentTarget.checked)]); | 348 [String(event.currentTarget.checked)]); |
349 }; | 349 }; |
350 } | 350 } |
| 351 if ($('metricsReportingEnabled') && !cr.isChromeOS) { |
| 352 var updateMetricsRestartButton = function() { |
| 353 $('metrics-reporting-reset-restart').hidden = |
| 354 loadTimeData.getBoolean('metricsReportingEnabledAtStart') == |
| 355 $('metricsReportingEnabled').checked; |
| 356 }; |
| 357 Preferences.getInstance().addEventListener( |
| 358 $('metricsReportingEnabled').getAttribute('pref'), |
| 359 updateMetricsRestartButton); |
| 360 $('metrics-reporting-reset-restart-button').onclick = function(event) { |
| 361 chrome.send('restartBrowser'); |
| 362 }; |
| 363 updateMetricsRestartButton(); |
| 364 } |
351 | 365 |
352 // Bluetooth (CrOS only). | 366 // Bluetooth (CrOS only). |
353 if (cr.isChromeOS) { | 367 if (cr.isChromeOS) { |
354 options.system.bluetooth.BluetoothDeviceList.decorate( | 368 options.system.bluetooth.BluetoothDeviceList.decorate( |
355 $('bluetooth-paired-devices-list')); | 369 $('bluetooth-paired-devices-list')); |
356 | 370 |
357 $('bluetooth-add-device').onclick = | 371 $('bluetooth-add-device').onclick = |
358 this.handleAddBluetoothDevice_.bind(this); | 372 this.handleAddBluetoothDevice_.bind(this); |
359 | 373 |
360 $('enable-bluetooth').onchange = function(event) { | 374 $('enable-bluetooth').onchange = function(event) { |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 BrowserOptions.getLoggedInUsername = function() { | 1895 BrowserOptions.getLoggedInUsername = function() { |
1882 return BrowserOptions.getInstance().username_; | 1896 return BrowserOptions.getInstance().username_; |
1883 }; | 1897 }; |
1884 } | 1898 } |
1885 | 1899 |
1886 // Export | 1900 // Export |
1887 return { | 1901 return { |
1888 BrowserOptions: BrowserOptions | 1902 BrowserOptions: BrowserOptions |
1889 }; | 1903 }; |
1890 }); | 1904 }); |
OLD | NEW |