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

Unified Diff: chrome/browser/chromeos/extensions/bluetooth_event_router.h

Issue 10815072: Bluetooth API: improve discovery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix licenses Created 8 years, 4 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/chromeos/extensions/bluetooth_event_router.h
diff --git a/chrome/browser/chromeos/extensions/bluetooth_event_router.h b/chrome/browser/chromeos/extensions/bluetooth_event_router.h
index 408ba48ee4ec512ae792fe7e9612c997542f4e78..652b0d5c6765a7bbf66790491af426eb6ea537e7 100644
--- a/chrome/browser/chromeos/extensions/bluetooth_event_router.h
+++ b/chrome/browser/chromeos/extensions/bluetooth_event_router.h
@@ -8,9 +8,11 @@
#include <map>
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_vector.h"
#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
#include "chrome/browser/chromeos/bluetooth/bluetooth_socket.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/extensions/api/experimental_bluetooth.h"
namespace chromeos {
@@ -35,6 +37,11 @@ class ExtensionBluetoothEventRouter
// Get the BluetoothSocket corresponding to |id|.
scoped_refptr<BluetoothSocket> GetSocket(int id);
+ // Sets whether this Profile is responsible for the discovering state of the
+ // adapter.
+ void SetResponsibleForDiscovery(bool responsible);
+ bool IsResponsibleForDiscovery() const;
+
// Sets whether or not DeviceAdded events will be dispatched to extensions.
void SetSendDiscoveryEvents(bool should_send);
@@ -54,8 +61,11 @@ class ExtensionBluetoothEventRouter
}
private:
void DispatchBooleanValueEvent(const char* event_name, bool value);
+ void DispatchDeviceEvent(
+ const extensions::api::experimental_bluetooth::Device& device);
bool send_discovery_events_;
+ bool responsible_for_discovery_;
Profile* profile_;
scoped_refptr<chromeos::BluetoothAdapter> adapter_;
@@ -68,6 +78,10 @@ class ExtensionBluetoothEventRouter
typedef std::map<int, scoped_refptr<BluetoothSocket> > SocketMap;
SocketMap socket_map_;
+ typedef ScopedVector<extensions::api::experimental_bluetooth::Device>
+ DeviceList;
+ DeviceList discovered_devices_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionBluetoothEventRouter);
};

Powered by Google App Engine
This is Rietveld 408576698