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

Side by Side Diff: device/bluetooth/bluetooth_adapter_win.cc

Issue 278663002: Implement chrome.bluetoothSocket.listenUsing*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix BluetoothAdapterMac include typo Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "device/bluetooth/bluetooth_adapter_win.h" 5 #include "device/bluetooth/bluetooth_adapter_win.h"
6 6
7 #include <hash_set> 7 #include <hash_set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/sequenced_task_runner.h" 12 #include "base/sequenced_task_runner.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
16 #include "device/bluetooth/bluetooth_device_win.h" 16 #include "device/bluetooth/bluetooth_device_win.h"
17 #include "device/bluetooth/bluetooth_socket_thread.h" 17 #include "device/bluetooth/bluetooth_socket_thread.h"
18 #include "device/bluetooth/bluetooth_socket_win.h"
18 #include "device/bluetooth/bluetooth_task_manager_win.h" 19 #include "device/bluetooth/bluetooth_task_manager_win.h"
20 #include "device/bluetooth/bluetooth_uuid.h"
19 21
20 namespace device { 22 namespace device {
21 23
22 // static 24 // static
23 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter( 25 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter(
24 const InitCallback& init_callback) { 26 const InitCallback& init_callback) {
25 return BluetoothAdapterWin::CreateAdapter(init_callback); 27 return BluetoothAdapterWin::CreateAdapter(init_callback);
26 } 28 }
27 29
28 // static 30 // static
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // If there are start discovery requests, post the start discovery again. 160 // If there are start discovery requests, post the start discovery again.
159 MaybePostStartDiscoveryTask(); 161 MaybePostStartDiscoveryTask();
160 } 162 }
161 163
162 void BluetoothAdapterWin::ReadLocalOutOfBandPairingData( 164 void BluetoothAdapterWin::ReadLocalOutOfBandPairingData(
163 const BluetoothOutOfBandPairingDataCallback& callback, 165 const BluetoothOutOfBandPairingDataCallback& callback,
164 const ErrorCallback& error_callback) { 166 const ErrorCallback& error_callback) {
165 NOTIMPLEMENTED(); 167 NOTIMPLEMENTED();
166 } 168 }
167 169
170 void BluetoothAdapterWin::CreateRfcommService(
171 const BluetoothUUID& uuid,
172 int channel,
173 bool insecure,
174 const CreateServiceCallback& callback,
175 const CreateServiceErrorCallback& error_callback) {
176 // TODO(keybuk): implement.
177 NOTIMPLEMENTED();
178 }
179
180 void BluetoothAdapterWin::CreateL2capService(
181 const BluetoothUUID& uuid,
182 int psm,
183 const CreateServiceCallback& callback,
184 const CreateServiceErrorCallback& error_callback) {
185 // TODO(keybuk): implement.
186 NOTIMPLEMENTED();
187 }
188
168 void BluetoothAdapterWin::RemovePairingDelegateInternal( 189 void BluetoothAdapterWin::RemovePairingDelegateInternal(
169 BluetoothDevice::PairingDelegate* pairing_delegate) { 190 BluetoothDevice::PairingDelegate* pairing_delegate) {
170 } 191 }
171 192
172 void BluetoothAdapterWin::AdapterStateChanged( 193 void BluetoothAdapterWin::AdapterStateChanged(
173 const BluetoothTaskManagerWin::AdapterState& state) { 194 const BluetoothTaskManagerWin::AdapterState& state) {
174 DCHECK(thread_checker_.CalledOnValidThread()); 195 DCHECK(thread_checker_.CalledOnValidThread());
175 name_ = state.name; 196 name_ = state.name;
176 bool was_present = IsPresent(); 197 bool was_present = IsPresent();
177 bool is_present = !state.address.empty(); 198 bool is_present = !state.address.empty();
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); 309 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size();
289 on_stop_discovery_callbacks_.clear(); 310 on_stop_discovery_callbacks_.clear();
290 return; 311 return;
291 } 312 }
292 313
293 discovery_status_ = DISCOVERY_STOPPING; 314 discovery_status_ = DISCOVERY_STOPPING;
294 task_manager_->PostStopDiscoveryTask(); 315 task_manager_->PostStopDiscoveryTask();
295 } 316 }
296 317
297 } // namespace device 318 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698