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

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

Issue 10899037: Refactoring bluetooth API code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing styles and tess. Created 8 years, 3 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 6715c4e374c1ca2c5e311f959463ff7f88f919d5..73181d3d14cb9b09a0fa77828e6ccb7bce9669b0 100644
--- a/chrome/browser/chromeos/extensions/bluetooth_event_router.h
+++ b/chrome/browser/chromeos/extensions/bluetooth_event_router.h
@@ -16,24 +16,30 @@
namespace chromeos {
+class BluetoothDevice;
+
class ExtensionBluetoothEventRouter
: public chromeos::BluetoothAdapter::Observer {
public:
explicit ExtensionBluetoothEventRouter(Profile* profile);
virtual ~ExtensionBluetoothEventRouter();
- const chromeos::BluetoothAdapter& adapter() const { return *adapter_.get(); }
+ const chromeos::BluetoothAdapter& adapter() const {
+ return *adapter_.get();
+ }
// GetMutableAdapter will never return NULL.
- chromeos::BluetoothAdapter* GetMutableAdapter() { return adapter_.get(); }
+ chromeos::BluetoothAdapter* GetMutableAdapter() {
+ return adapter_.get();
+ }
// Register the BluetoothSocket |socket| for use by the extensions system.
// This class will hold onto the socket for its lifetime, or until
// ReleaseSocket is called for the socket. Returns an id for the socket.
int RegisterSocket(scoped_refptr<BluetoothSocket> socket);
- // Release the BluetoothSocket corresponding to |id|. Returns true if
- // the socket was found and released, false otherwise.
+ // Release the BluetoothSocket corresponding to |id|. Returns true if the
+ // socket was found and released, false otherwise.
bool ReleaseSocket(int id);
// Get the BluetoothSocket corresponding to |id|.
@@ -53,14 +59,20 @@ class ExtensionBluetoothEventRouter
const extensions::api::experimental_bluetooth::Device& device);
// Override from chromeos::BluetoothAdapter::Observer
- virtual void AdapterPresentChanged(chromeos::BluetoothAdapter* adapter,
- bool present) OVERRIDE;
- virtual void AdapterPoweredChanged(chromeos::BluetoothAdapter* adapter,
- bool has_power) OVERRIDE;
- virtual void AdapterDiscoveringChanged(chromeos::BluetoothAdapter* adapter,
- bool discovering) OVERRIDE;
- virtual void DeviceAdded(chromeos::BluetoothAdapter* adapter,
- chromeos::BluetoothDevice* device) OVERRIDE;
+ virtual void AdapterPresentChanged(
+ chromeos::BluetoothAdapter* adapter, bool present) OVERRIDE;
+ virtual void AdapterPoweredChanged(
+ chromeos::BluetoothAdapter* adapter, bool has_power) OVERRIDE;
+ virtual void AdapterDiscoveringChanged(
+ chromeos::BluetoothAdapter* adapter, bool discovering) OVERRIDE;
+ virtual void DeviceAdded(BluetoothAdapter* adapter,
+ BluetoothDevice* device) OVERRIDE;
+
+ virtual void DeviceChanged(BluetoothAdapter* adapter,
+ BluetoothDevice* device) OVERRIDE;
+
+ virtual void DeviceRemoved(BluetoothAdapter* adapter,
+ BluetoothDevice* device) OVERRIDE;
// Exposed for testing.
void SetAdapterForTest(chromeos::BluetoothAdapter* adapter) {
@@ -75,9 +87,9 @@ class ExtensionBluetoothEventRouter
Profile* profile_;
scoped_refptr<chromeos::BluetoothAdapter> adapter_;
- // The next id to use for referring to a BluetoothSocket. We avoid using
- // the fd of the socket because we don't want to leak that information to
- // the extension javascript.
+ // The next id to use for referring to a BluetoothSocket. We avoid using the
+ // fd of the socket because we don't want to leak that information to the
+ // extension javascript.
int next_socket_id_;
typedef std::map<int, scoped_refptr<BluetoothSocket> > SocketMap;

Powered by Google App Engine
This is Rietveld 408576698