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

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: review comments 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..b03fa51fb3af0b86371f0c34594c8acf7e5cf438 100644
--- a/chrome/browser/chromeos/extensions/bluetooth_event_router.h
+++ b/chrome/browser/chromeos/extensions/bluetooth_event_router.h
@@ -7,10 +7,12 @@
#include <map>
+#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.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,11 @@ class ExtensionBluetoothEventRouter
typedef std::map<int, scoped_refptr<BluetoothSocket> > SocketMap;
SocketMap socket_map_;
+ typedef std::vector<
+ linked_ptr<extensions::api::experimental_bluetooth::Device> >
+ DeviceList;
asargent_no_longer_on_chrome 2012/08/03 23:35:23 Can this be a ScopedVector instead of a vector of
bryeung 2012/08/07 14:22:12 I had missed that thread: thanks for pointing it o
+ DeviceList discovered_devices_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionBluetoothEventRouter);
};

Powered by Google App Engine
This is Rietveld 408576698