| 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 EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ |
| 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ | 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 BluetoothApiPairingDelegate* GetPairingDelegate( | 85 BluetoothApiPairingDelegate* GetPairingDelegate( |
| 86 const std::string& extension_id); | 86 const std::string& extension_id); |
| 87 | 87 |
| 88 // Exposed for testing. | 88 // Exposed for testing. |
| 89 void SetAdapterForTest(device::BluetoothAdapter* adapter) { | 89 void SetAdapterForTest(device::BluetoothAdapter* adapter) { |
| 90 adapter_ = adapter; | 90 adapter_ = adapter; |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Override from device::BluetoothAdapter::Observer. | 93 // Override from device::BluetoothAdapter::Observer. |
| 94 virtual void AdapterPresentChanged(device::BluetoothAdapter* adapter, | 94 virtual void AdapterPresentChanged(device::BluetoothAdapter* adapter, |
| 95 bool present) OVERRIDE; | 95 bool present) override; |
| 96 virtual void AdapterPoweredChanged(device::BluetoothAdapter* adapter, | 96 virtual void AdapterPoweredChanged(device::BluetoothAdapter* adapter, |
| 97 bool has_power) OVERRIDE; | 97 bool has_power) override; |
| 98 virtual void AdapterDiscoveringChanged(device::BluetoothAdapter* adapter, | 98 virtual void AdapterDiscoveringChanged(device::BluetoothAdapter* adapter, |
| 99 bool discovering) OVERRIDE; | 99 bool discovering) override; |
| 100 virtual void DeviceAdded(device::BluetoothAdapter* adapter, | 100 virtual void DeviceAdded(device::BluetoothAdapter* adapter, |
| 101 device::BluetoothDevice* device) OVERRIDE; | 101 device::BluetoothDevice* device) override; |
| 102 virtual void DeviceChanged(device::BluetoothAdapter* adapter, | 102 virtual void DeviceChanged(device::BluetoothAdapter* adapter, |
| 103 device::BluetoothDevice* device) OVERRIDE; | 103 device::BluetoothDevice* device) override; |
| 104 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, | 104 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, |
| 105 device::BluetoothDevice* device) OVERRIDE; | 105 device::BluetoothDevice* device) override; |
| 106 | 106 |
| 107 // Overridden from content::NotificationObserver. | 107 // Overridden from content::NotificationObserver. |
| 108 virtual void Observe(int type, | 108 virtual void Observe(int type, |
| 109 const content::NotificationSource& source, | 109 const content::NotificationSource& source, |
| 110 const content::NotificationDetails& details) OVERRIDE; | 110 const content::NotificationDetails& details) override; |
| 111 | 111 |
| 112 // Overridden from ExtensionRegistryObserver. | 112 // Overridden from ExtensionRegistryObserver. |
| 113 virtual void OnExtensionUnloaded( | 113 virtual void OnExtensionUnloaded( |
| 114 content::BrowserContext* browser_context, | 114 content::BrowserContext* browser_context, |
| 115 const Extension* extension, | 115 const Extension* extension, |
| 116 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 116 UnloadedExtensionInfo::Reason reason) override; |
| 117 | 117 |
| 118 // BrowserContextKeyedAPI implementation. | 118 // BrowserContextKeyedAPI implementation. |
| 119 static const char* service_name() { return "BluetoothEventRouter"; } | 119 static const char* service_name() { return "BluetoothEventRouter"; } |
| 120 static const bool kServiceRedirectedInIncognito = true; | 120 static const bool kServiceRedirectedInIncognito = true; |
| 121 static const bool kServiceIsNULLWhileTesting = true; | 121 static const bool kServiceIsNULLWhileTesting = true; |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 void OnAdapterInitialized(const base::Closure& callback, | 124 void OnAdapterInitialized(const base::Closure& callback, |
| 125 scoped_refptr<device::BluetoothAdapter> adapter); | 125 scoped_refptr<device::BluetoothAdapter> adapter); |
| 126 void MaybeReleaseAdapter(); | 126 void MaybeReleaseAdapter(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 155 extension_registry_observer_; | 155 extension_registry_observer_; |
| 156 | 156 |
| 157 base::WeakPtrFactory<BluetoothEventRouter> weak_ptr_factory_; | 157 base::WeakPtrFactory<BluetoothEventRouter> weak_ptr_factory_; |
| 158 | 158 |
| 159 DISALLOW_COPY_AND_ASSIGN(BluetoothEventRouter); | 159 DISALLOW_COPY_AND_ASSIGN(BluetoothEventRouter); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 } // namespace extensions | 162 } // namespace extensions |
| 163 | 163 |
| 164 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ | 164 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ |
| OLD | NEW |