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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h

Issue 12018024: Implemented Asynchronous Initialization of BluetoothAdapter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Turned adapter_callbacks to a lazy instance. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 11 matching lines...) Expand all
22 class ExtensionBluetoothEventRouter 22 class ExtensionBluetoothEventRouter
23 : public device::BluetoothAdapter::Observer { 23 : public device::BluetoothAdapter::Observer {
24 public: 24 public:
25 explicit ExtensionBluetoothEventRouter(Profile* profile); 25 explicit ExtensionBluetoothEventRouter(Profile* profile);
26 virtual ~ExtensionBluetoothEventRouter(); 26 virtual ~ExtensionBluetoothEventRouter();
27 27
28 // Returns true if adapter_ has been initialized for testing or bluetooth 28 // Returns true if adapter_ has been initialized for testing or bluetooth
29 // adapter is available for the current platform. 29 // adapter is available for the current platform.
30 bool IsBluetoothSupported() const; 30 bool IsBluetoothSupported() const;
31 31
32 void RunCallbackOnAdapterReady( 32 void GetAdapter(
33 const device::BluetoothAdapter::AdapterCallback& callback); 33 const device::BluetoothAdapterFactory::AdapterCallback& callback);
34 34
35 // Called when a bluetooth event listener is added. 35 // Called when a bluetooth event listener is added.
36 void OnListenerAdded(); 36 void OnListenerAdded();
37 37
38 // Called when a bluetooth event listener is removed. 38 // Called when a bluetooth event listener is removed.
39 void OnListenerRemoved(); 39 void OnListenerRemoved();
40 40
41 // Register the BluetoothSocket |socket| for use by the extensions system. 41 // Register the BluetoothSocket |socket| for use by the extensions system.
42 // This class will hold onto the socket for its lifetime, or until 42 // This class will hold onto the socket for its lifetime, or until
43 // ReleaseSocket is called for the socket. Returns an id for the socket. 43 // ReleaseSocket is called for the socket. Returns an id for the socket.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 DeviceList discovered_devices_; 104 DeviceList discovered_devices_;
105 105
106 base::WeakPtrFactory<ExtensionBluetoothEventRouter> weak_ptr_factory_; 106 base::WeakPtrFactory<ExtensionBluetoothEventRouter> weak_ptr_factory_;
107 107
108 DISALLOW_COPY_AND_ASSIGN(ExtensionBluetoothEventRouter); 108 DISALLOW_COPY_AND_ASSIGN(ExtensionBluetoothEventRouter);
109 }; 109 };
110 110
111 } // namespace extensions 111 } // namespace extensions
112 112
113 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ 113 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698