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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 124 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
125 const Extension* extension, | 125 const Extension* extension, |
126 UnloadedExtensionInfo::Reason reason) override; | 126 UnloadedExtensionInfo::Reason reason) override; |
127 | 127 |
128 // BrowserContextKeyedAPI implementation. | 128 // BrowserContextKeyedAPI implementation. |
129 static const char* service_name() { return "BluetoothEventRouter"; } | 129 static const char* service_name() { return "BluetoothEventRouter"; } |
130 static const bool kServiceRedirectedInIncognito = true; | 130 static const bool kServiceRedirectedInIncognito = true; |
131 static const bool kServiceIsNULLWhileTesting = true; | 131 static const bool kServiceIsNULLWhileTesting = true; |
132 | 132 |
133 private: | 133 private: |
| 134 void StartDiscoverySessionImpl(device::BluetoothAdapter* adapter, |
| 135 const std::string& extension_id, |
| 136 const base::Closure& callback, |
| 137 const base::Closure& error_callback); |
| 138 void AddPairingDelegateImpl(const std::string& extension_id); |
| 139 |
134 void OnAdapterInitialized(const base::Closure& callback, | 140 void OnAdapterInitialized(const base::Closure& callback, |
135 scoped_refptr<device::BluetoothAdapter> adapter); | 141 scoped_refptr<device::BluetoothAdapter> adapter); |
136 void MaybeReleaseAdapter(); | 142 void MaybeReleaseAdapter(); |
137 void DispatchAdapterStateEvent(); | 143 void DispatchAdapterStateEvent(); |
138 void DispatchDeviceEvent(events::HistogramValue histogram_value, | 144 void DispatchDeviceEvent(events::HistogramValue histogram_value, |
139 const std::string& event_name, | 145 const std::string& event_name, |
140 device::BluetoothDevice* device); | 146 device::BluetoothDevice* device); |
141 void CleanUpForExtension(const std::string& extension_id); | 147 void CleanUpForExtension(const std::string& extension_id); |
142 void CleanUpAllExtensions(); | 148 void CleanUpAllExtensions(); |
143 void OnStartDiscoverySession( | 149 void OnStartDiscoverySession( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 extension_registry_observer_; | 181 extension_registry_observer_; |
176 | 182 |
177 base::WeakPtrFactory<BluetoothEventRouter> weak_ptr_factory_; | 183 base::WeakPtrFactory<BluetoothEventRouter> weak_ptr_factory_; |
178 | 184 |
179 DISALLOW_COPY_AND_ASSIGN(BluetoothEventRouter); | 185 DISALLOW_COPY_AND_ASSIGN(BluetoothEventRouter); |
180 }; | 186 }; |
181 | 187 |
182 } // namespace extensions | 188 } // namespace extensions |
183 | 189 |
184 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ | 190 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_EVENT_ROUTER_H_ |
OLD | NEW |