Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8736)

Unified Diff: chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h

Issue 184953002: Migrate Chrome OS Bluetooth UI to the new discovery API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments by derat@ and keybuk@. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h
diff --git a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h
index 162db1af8b13cfecd9d72d93d0d1ee9cc370874e..0c4ae95b771ed4fe055c6b6e49aded68a09e1284 100644
--- a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h
+++ b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h
@@ -14,6 +14,7 @@
#include "chrome/browser/ui/webui/options/options_ui.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/bluetooth_discovery_session.h"
namespace base {
class DictionaryValue;
@@ -154,12 +155,17 @@ class BluetoothOptionsHandler
// change the power status of the adapter.
void EnableChangeError();
+ // Called by device::BluetoothAdapter in response to a successful request
+ // to initiate a discovery session.
+ void OnStartDiscoverySession(
+ scoped_ptr<device::BluetoothDiscoverySession> discovery_session);
+
// Called by device::BluetoothAdapter in response to a failure to
- // set the adapter into discovery mode.
+ // initiate a discovery session.
void FindDevicesError();
// Called by device::BluetoothAdapter in response to a failure to
- // remove the adapter from discovery mode.
+ // terminate a discovery session.
void StopDiscoveryError();
// Called by device::BluetoothDevice on a successful pairing and connection
@@ -210,8 +216,15 @@ class BluetoothOptionsHandler
// Default bluetooth adapter, used for all operations.
scoped_refptr<device::BluetoothAdapter> adapter_;
- // True while performing device discovery.
- bool discovering_;
+ // True, if the UI has requested device discovery. False, if either no device
+ // discovery was requested or the dialog responsible for device discovery was
+ // dismissed.
+ bool should_run_device_discovery_;
+
+ // The current device discovery session. Only one active discovery session is
+ // kept at a time and the instance that |discovery_session_| points to gets
+ // replaced by a new one when a new discovery session is initiated.
+ scoped_ptr<device::BluetoothDiscoverySession> discovery_session_;
// Cached information about the current pairing device, if any.
std::string pairing_device_address_;

Powered by Google App Engine
This is Rietveld 408576698