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

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

Issue 1284073002: bluetooth: Add adapter to BluetoothDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-drop-callback-
Patch Set: Merge TOT Created 5 years, 3 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
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 <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 base::STLSetDifference<DeviceAddressSet>(new_devices, known_devices); 265 base::STLSetDifference<DeviceAddressSet>(new_devices, known_devices);
266 DeviceAddressSet changed_devices = 266 DeviceAddressSet changed_devices =
267 base::STLSetIntersection<DeviceAddressSet>(known_devices, new_devices); 267 base::STLSetIntersection<DeviceAddressSet>(known_devices, new_devices);
268 for (ScopedVector<BluetoothTaskManagerWin::DeviceState>::const_iterator iter = 268 for (ScopedVector<BluetoothTaskManagerWin::DeviceState>::const_iterator iter =
269 devices.begin(); 269 devices.begin();
270 iter != devices.end(); 270 iter != devices.end();
271 ++iter) { 271 ++iter) {
272 BluetoothTaskManagerWin::DeviceState* device_state = (*iter); 272 BluetoothTaskManagerWin::DeviceState* device_state = (*iter);
273 if (added_devices.find(device_state->address) != added_devices.end()) { 273 if (added_devices.find(device_state->address) != added_devices.end()) {
274 BluetoothDeviceWin* device_win = 274 BluetoothDeviceWin* device_win =
275 new BluetoothDeviceWin(*device_state, 275 new BluetoothDeviceWin(this, *device_state, ui_task_runner_,
276 ui_task_runner_, 276 socket_thread_, NULL, net::NetLog::Source());
277 socket_thread_,
278 NULL,
279 net::NetLog::Source());
280 devices_[device_state->address] = device_win; 277 devices_[device_state->address] = device_win;
281 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, 278 FOR_EACH_OBSERVER(BluetoothAdapter::Observer,
282 observers_, 279 observers_,
283 DeviceAdded(this, device_win)); 280 DeviceAdded(this, device_win));
284 } else if (changed_devices.find(device_state->address) != 281 } else if (changed_devices.find(device_state->address) !=
285 changed_devices.end()) { 282 changed_devices.end()) {
286 BluetoothDeviceWin* device_win = 283 BluetoothDeviceWin* device_win =
287 static_cast<BluetoothDeviceWin*>(devices_[device_state->address]); 284 static_cast<BluetoothDeviceWin*>(devices_[device_state->address]);
288 if (!device_win->IsEqual(*device_state)) { 285 if (!device_win->IsEqual(*device_state)) {
289 device_win->Update(*device_state); 286 device_win->Update(*device_state);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); 369 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size();
373 on_stop_discovery_callbacks_.clear(); 370 on_stop_discovery_callbacks_.clear();
374 return; 371 return;
375 } 372 }
376 373
377 discovery_status_ = DISCOVERY_STOPPING; 374 discovery_status_ = DISCOVERY_STOPPING;
378 task_manager_->PostStopDiscoveryTask(); 375 task_manager_->PostStopDiscoveryTask();
379 } 376 }
380 377
381 } // namespace device 378 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_mac_unittest.mm ('k') | device/bluetooth/bluetooth_classic_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698