diff options
author | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-24 00:36:35 +0000 |
---|---|---|
committer | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-24 00:36:35 +0000 |
commit | 424d1bb2d46d3dc43713ed4e347a7f12182f0491 (patch) | |
tree | 01d0bd883795ed7199fbbf94e3aedc41d92cb174 /chrome/browser/resources/chromeos/browser_options.js | |
parent | 5c9a983de3d304293cc7051cb726fed2241eb9f2 (diff) | |
download | chromium_src-424d1bb2d46d3dc43713ed4e347a7f12182f0491.zip chromium_src-424d1bb2d46d3dc43713ed4e347a7f12182f0491.tar.gz chromium_src-424d1bb2d46d3dc43713ed4e347a7f12182f0491.tar.bz2 |
Make Bluetooth pairing dialog working from uber tray.
TBR=sky
BUG=130698
Review URL: https://codereview.chromium.org/12047057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/chromeos/browser_options.js')
-rw-r--r-- | chrome/browser/resources/chromeos/browser_options.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/chrome/browser/resources/chromeos/browser_options.js b/chrome/browser/resources/chromeos/browser_options.js new file mode 100644 index 0000000..938e97e --- /dev/null +++ b/chrome/browser/resources/chromeos/browser_options.js @@ -0,0 +1,64 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +cr.define('options', function() { + /** @const */ var OptionsPage = options.OptionsPage; + + /** + * Encapsulated handling of the BrowserOptions calls from + * BluetoothOptionsHandler that is registered by the webUI, + * ie, BluetoothPairingUI. + * @constructor + */ + function BrowserOptions() { + OptionsPage.call(this, + 'bluetooth', + '', + 'bluetooth-container'); + } + + cr.addSingletonGetter(BrowserOptions); + + BrowserOptions.prototype = { + __proto__: OptionsPage.prototype, + + /** @override */ + initializePage: function() { + OptionsPage.prototype.initializePage.call(this); + }, + }; + + BrowserOptions.showBluetoothSettings = function() { + }; + + BrowserOptions.setBluetoothState = function() { + }; + + /** + * Handles addBluetoothDevice call, display the Bluetooth pairing overlay + * for the pairing device. + * @param {{name: string, + * address: string, + * paired: boolean, + * bonded: boolean, + * pairing: string | undefined + * pincode: string | undefined + * passkey: number | undefined + * connected: boolean}} device + */ + BrowserOptions.addBluetoothDevice = function(device) { + // One device can be in the process of pairing. If found, display + // the Bluetooth pairing overlay. + if (device.pairing) + BluetoothPairing.showDialog(device); + }; + + BrowserOptions.removeBluetoothDevice = function(address) { + }; + + // Export + return { + BrowserOptions: BrowserOptions + }; +}); |