| OLD | NEW |
| 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_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class BluetoothSocket; | 23 class BluetoothSocket; |
| 24 struct BluetoothOutOfBandPairingData; | 24 struct BluetoothOutOfBandPairingData; |
| 25 | 25 |
| 26 } // namespace device | 26 } // namespace device |
| 27 | 27 |
| 28 namespace extensions { | 28 namespace extensions { |
| 29 | 29 |
| 30 class ExtensionBluetoothEventRouter; | 30 class ExtensionBluetoothEventRouter; |
| 31 | 31 |
| 32 // The profile-keyed service that manages the bluetooth extension API. | 32 // The profile-keyed service that manages the bluetooth extension API. |
| 33 class BluetoothAPI : public ProfileKeyedService, | 33 class BluetoothAPI : public BrowserContextKeyedService, |
| 34 public EventRouter::Observer { | 34 public EventRouter::Observer { |
| 35 public: | 35 public: |
| 36 // Convenience method to get the BluetoothAPI for a profile. | 36 // Convenience method to get the BluetoothAPI for a profile. |
| 37 static BluetoothAPI* Get(Profile* profile); | 37 static BluetoothAPI* Get(Profile* profile); |
| 38 | 38 |
| 39 explicit BluetoothAPI(Profile* profile); | 39 explicit BluetoothAPI(Profile* profile); |
| 40 virtual ~BluetoothAPI(); | 40 virtual ~BluetoothAPI(); |
| 41 | 41 |
| 42 ExtensionBluetoothEventRouter* bluetooth_event_router(); | 42 ExtensionBluetoothEventRouter* bluetooth_event_router(); |
| 43 | 43 |
| 44 // ProfileKeyedService implementation. | 44 // BrowserContextKeyedService implementation. |
| 45 virtual void Shutdown() OVERRIDE; | 45 virtual void Shutdown() OVERRIDE; |
| 46 | 46 |
| 47 // EventRouter::Observer implementation. | 47 // EventRouter::Observer implementation. |
| 48 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 48 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
| 49 virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE; | 49 virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 Profile* profile_; | 52 Profile* profile_; |
| 53 | 53 |
| 54 // Created lazily on first access. | 54 // Created lazily on first access. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 private: | 271 private: |
| 272 void OnSuccessCallback(); | 272 void OnSuccessCallback(); |
| 273 void OnErrorCallback(); | 273 void OnErrorCallback(); |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 } // namespace api | 276 } // namespace api |
| 277 } // namespace extensions | 277 } // namespace extensions |
| 278 | 278 |
| 279 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 279 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
| OLD | NEW |