[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / browser_options.js
blobde2b8f7abbf6160b11281c5ea436f7f6b47fea5f
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 cr.define('options', function() {
6 /** @const */ var OptionsPage = options.OptionsPage;
8 /**
9 * Encapsulated handling of the BrowserOptions calls from
10 * BluetoothOptionsHandler that is registered by the webUI,
11 * ie, BluetoothPairingUI.
12 * @constructor
14 function BrowserOptions() {
15 OptionsPage.call(this,
16 'bluetooth',
17 '',
18 'bluetooth-container');
21 cr.addSingletonGetter(BrowserOptions);
23 BrowserOptions.prototype = {
24 __proto__: OptionsPage.prototype,
26 /** @override */
27 initializePage: function() {
28 OptionsPage.prototype.initializePage.call(this);
32 BrowserOptions.showBluetoothSettings = function() {
35 BrowserOptions.setBluetoothState = function() {
38 /**
39 * Handles addBluetoothDevice call, display the Bluetooth pairing overlay
40 * for the pairing device.
41 * @param {{name: string,
42 * address: string,
43 * paired: boolean,
44 * pairing: string | undefined
45 * pincode: string | undefined
46 * passkey: number | undefined
47 * connected: boolean}} device
49 BrowserOptions.addBluetoothDevice = function(device) {
50 // One device can be in the process of pairing. If found, display
51 // the Bluetooth pairing overlay.
52 if (device.pairing)
53 BluetoothPairing.showDialog(device);
56 BrowserOptions.removeBluetoothDevice = function(address) {
59 // Export
60 return {
61 BrowserOptions: BrowserOptions
63 });