| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void StopDiscoverySession(device::BluetoothAdapter* adapter, | 67 void StopDiscoverySession(device::BluetoothAdapter* adapter, |
| 68 const std::string& extension_id, | 68 const std::string& extension_id, |
| 69 const base::Closure& callback, | 69 const base::Closure& callback, |
| 70 const base::Closure& error_callback); | 70 const base::Closure& error_callback); |
| 71 | 71 |
| 72 // Requests that the filter associated with discovery session that belongs | 72 // Requests that the filter associated with discovery session that belongs |
| 73 // to the extension with id |extension_id| be set to |discovery_filter|. | 73 // to the extension with id |extension_id| be set to |discovery_filter|. |
| 74 // Callback is called, if the filter was successfully updated. | 74 // Callback is called, if the filter was successfully updated. |
| 75 // |error_callback| is called, if filter update failed. | 75 // |error_callback| is called, if filter update failed. |
| 76 void SetDiscoveryFilter( | 76 void SetDiscoveryFilter( |
| 77 scoped_ptr<device::BluetoothDiscoveryFilter> discovery_filter, | 77 std::unique_ptr<device::BluetoothDiscoveryFilter> discovery_filter, |
| 78 device::BluetoothAdapter* adapter, | 78 device::BluetoothAdapter* adapter, |
| 79 const std::string& extension_id, | 79 const std::string& extension_id, |
| 80 const base::Closure& callback, | 80 const base::Closure& callback, |
| 81 const base::Closure& error_callback); | 81 const base::Closure& error_callback); |
| 82 | 82 |
| 83 // Called when a bluetooth event listener is added. | 83 // Called when a bluetooth event listener is added. |
| 84 void OnListenerAdded(); | 84 void OnListenerAdded(); |
| 85 | 85 |
| 86 // Called when a bluetooth event listener is removed. | 86 // Called when a bluetooth event listener is removed. |
| 87 void OnListenerRemoved(); | 87 void OnListenerRemoved(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void MaybeReleaseAdapter(); | 144 void MaybeReleaseAdapter(); |
| 145 void DispatchAdapterStateEvent(); | 145 void DispatchAdapterStateEvent(); |
| 146 void DispatchDeviceEvent(events::HistogramValue histogram_value, | 146 void DispatchDeviceEvent(events::HistogramValue histogram_value, |
| 147 const std::string& event_name, | 147 const std::string& event_name, |
| 148 device::BluetoothDevice* device); | 148 device::BluetoothDevice* device); |
| 149 void CleanUpForExtension(const std::string& extension_id); | 149 void CleanUpForExtension(const std::string& extension_id); |
| 150 void CleanUpAllExtensions(); | 150 void CleanUpAllExtensions(); |
| 151 void OnStartDiscoverySession( | 151 void OnStartDiscoverySession( |
| 152 const std::string& extension_id, | 152 const std::string& extension_id, |
| 153 const base::Closure& callback, | 153 const base::Closure& callback, |
| 154 scoped_ptr<device::BluetoothDiscoverySession> discovery_session); | 154 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session); |
| 155 | 155 |
| 156 void OnSetDiscoveryFilter(const std::string& extension_id, | 156 void OnSetDiscoveryFilter(const std::string& extension_id, |
| 157 const base::Closure& callback); | 157 const base::Closure& callback); |
| 158 | 158 |
| 159 content::BrowserContext* browser_context_; | 159 content::BrowserContext* browser_context_; |
| 160 scoped_refptr<device::BluetoothAdapter> adapter_; | 160 scoped_refptr<device::BluetoothAdapter> adapter_; |
| 161 | 161 |
| 162 int num_event_listeners_; | 162 int num_event_listeners_; |
| 163 | 163 |
| 164 // A map that maps extension ids to BluetoothDiscoverySession pointers. | 164 // A map that maps extension ids to BluetoothDiscoverySession pointers. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 183 extension_registry_observer_; | 183 extension_registry_observer_; |
| 184 | 184 |
| 185 base::WeakPtrFactory<BluetoothEventRouter> weak_ptr_factory_; | 185 base::WeakPtrFactory<BluetoothEventRouter> weak_ptr_factory_; |
| 186 | 186 |
| 187 DISALLOW_COPY_AND_ASSIGN(BluetoothEventRouter); | 187 DISALLOW_COPY_AND_ASSIGN(BluetoothEventRouter); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 } // namespace extensions | 190 } // namespace extensions |
| 191 | 191 |
| 192 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ | 192 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ |
| OLD | NEW |