Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / chromeos / browser_options.js
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.
4
5 cr.define('options', function() {
6   /** @const */ var Page = cr.ui.pageManager.Page;
7
8   /**
9    * Encapsulated handling of the BrowserOptions calls from
10    * BluetoothOptionsHandler that is registered by the webUI,
11    * ie, BluetoothPairingUI.
12    * @constructor
13    */
14   function BrowserOptions() {
15     Page.call(this, 'bluetooth', '', 'bluetooth-container');
16   }
17
18   cr.addSingletonGetter(BrowserOptions);
19
20   BrowserOptions.prototype = {
21     __proto__: Page.prototype,
22   };
23
24   BrowserOptions.showBluetoothSettings = function() {
25   };
26
27   BrowserOptions.setBluetoothState = function() {
28   };
29
30   /**
31    * Handles addBluetoothDevice call, display the Bluetooth pairing overlay
32    * for the pairing device.
33    * @param {{name: string,
34    *          address: string,
35    *          paired: boolean,
36    *          pairing: string | undefined
37    *          pincode: string | undefined
38    *          passkey: number | undefined
39    *          connected: boolean}} device
40    */
41   BrowserOptions.addBluetoothDevice = function(device) {
42     // One device can be in the process of pairing.  If found, display
43     // the Bluetooth pairing overlay.
44     if (device.pairing)
45       BluetoothPairing.showDialog(device);
46   };
47
48   BrowserOptions.removeBluetoothDevice = function(address) {
49   };
50
51   // Export
52   return {
53     BrowserOptions: BrowserOptions
54   };
55 });