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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.h

Issue 787953004: bluetooth: Use BluetoothAdapter in BluetoothDispatcherHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: virtual/override replaced Created 5 years, 11 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
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.h
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.h b/content/browser/bluetooth/bluetooth_dispatcher_host.h
index 5ab67cfd888b88cf329ce76e173cfc3432ce342e..8d96af78dbf49035810b4effc9ad6846040791f3 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "content/common/bluetooth/bluetooth_error.h"
#include "content/public/browser/browser_message_filter.h"
+#include "device/bluetooth/bluetooth_adapter.h"
namespace content {
@@ -17,21 +18,31 @@ namespace content {
// Intended to be instantiated by the RenderProcessHost and installed as
// a filter on the channel. BrowserMessageFilter is refcounted and typically
// lives as long as it is installed on a channel.
-class BluetoothDispatcherHost : public BrowserMessageFilter {
+class BluetoothDispatcherHost : public BrowserMessageFilter,
+ public device::BluetoothAdapter::Observer {
public:
- BluetoothDispatcherHost();
+ // Creates a BluetoothDispatcherHost.
+ static scoped_refptr<BluetoothDispatcherHost> Create();
// BrowserMessageFilter:
bool OnMessageReceived(const IPC::Message& message) override;
protected:
+ BluetoothDispatcherHost();
~BluetoothDispatcherHost() override;
private:
+ // Set |adapter_| to a BluetoothAdapter instance and register observers,
+ // releasing references to previous |adapter_|.
+ void set_adapter(scoped_refptr<device::BluetoothAdapter> adapter);
+
// IPC Handlers, see definitions in bluetooth_messages.h.
void OnRequestDevice(int thread_id, int request_id);
void OnSetBluetoothMockDataSetForTesting(const std::string& name);
+ // A BluetoothAdapter instance representing an adapter of the system.
+ scoped_refptr<device::BluetoothAdapter> adapter_;
+
enum class MockData { NOT_MOCKING, REJECT, RESOLVE };
MockData bluetooth_mock_data_set_;
BluetoothError bluetooth_request_device_reject_type_;
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698