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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_event_router.h

Issue 2801403002: MD Settings: Bluetooth: Fix adapter state and discovery (Closed)
Patch Set: Use CHECK instead of early exit Created 3 years, 8 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: extensions/browser/api/bluetooth/bluetooth_event_router.h
diff --git a/extensions/browser/api/bluetooth/bluetooth_event_router.h b/extensions/browser/api/bluetooth/bluetooth_event_router.h
index 4d2fb55fdfaf72b4fc72b6783970c693e1d3bbf3..ed90b1a8027bb0d0011aa59adab67597049042da 100644
--- a/extensions/browser/api/bluetooth/bluetooth_event_router.h
+++ b/extensions/browser/api/bluetooth/bluetooth_event_router.h
@@ -35,6 +35,7 @@ class BluetoothDiscoverySession;
namespace extensions {
class BluetoothApiPairingDelegate;
class ExtensionRegistry;
+struct EventListenerInfo;
class BluetoothEventRouter : public device::BluetoothAdapter::Observer,
public content::NotificationObserver,
@@ -81,10 +82,10 @@ class BluetoothEventRouter : public device::BluetoothAdapter::Observer,
const base::Closure& error_callback);
// Called when a bluetooth event listener is added.
- void OnListenerAdded();
+ void OnListenerAdded(const EventListenerInfo& details);
// Called when a bluetooth event listener is removed.
- void OnListenerRemoved();
+ void OnListenerRemoved(const EventListenerInfo& details);
// Adds a pairing delegate for an extension.
void AddPairingDelegate(const std::string& extension_id);
@@ -159,7 +160,8 @@ class BluetoothEventRouter : public device::BluetoothAdapter::Observer,
content::BrowserContext* browser_context_;
scoped_refptr<device::BluetoothAdapter> adapter_;
- int num_event_listeners_;
+ // Map of listener id -> listener count.
+ std::map<std::string, int> event_listener_count_;
// A map that maps extension ids to BluetoothDiscoverySession pointers.
typedef std::map<std::string, device::BluetoothDiscoverySession*>
« no previous file with comments | « extensions/browser/api/bluetooth/bluetooth_api.cc ('k') | extensions/browser/api/bluetooth/bluetooth_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698