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 #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 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 DevicesMap::iterator device_iter = devices_.begin(); | 209 DevicesMap::iterator device_iter = devices_.begin(); |
210 while (device_iter != devices_.end()) { | 210 while (device_iter != devices_.end()) { |
211 if (device_address_list.find(device_iter->first) != | 211 if (device_address_list.find(device_iter->first) != |
212 device_address_list.end()) { | 212 device_address_list.end()) { |
213 ++device_iter; | 213 ++device_iter; |
214 continue; | 214 continue; |
215 } | 215 } |
216 if (device_iter->second->IsConnected() || device_iter->second->IsPaired()) { | 216 if (device_iter->second->IsConnected() || device_iter->second->IsPaired()) { |
217 BluetoothDeviceWin* device_win = | 217 BluetoothDeviceWin* device_win = |
218 static_cast<BluetoothDeviceWin*>(device_iter->second); | 218 static_cast<BluetoothDeviceWin*>(device_iter->second); |
219 device_win->SetVisible(false); | |
220 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 219 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
221 DeviceChanged(this, device_win)); | 220 DeviceChanged(this, device_win)); |
222 ++device_iter; | 221 ++device_iter; |
223 continue; | 222 continue; |
224 } | 223 } |
225 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 224 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
226 DeviceRemoved(this, device_iter->second)); | 225 DeviceRemoved(this, device_iter->second)); |
227 delete device_iter->second; | 226 delete device_iter->second; |
228 device_iter = devices_.erase(device_iter); | 227 device_iter = devices_.erase(device_iter); |
229 } | 228 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); | 268 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); |
270 on_stop_discovery_callbacks_.clear(); | 269 on_stop_discovery_callbacks_.clear(); |
271 return; | 270 return; |
272 } | 271 } |
273 | 272 |
274 discovery_status_ = DISCOVERY_STOPPING; | 273 discovery_status_ = DISCOVERY_STOPPING; |
275 task_manager_->PostStopDiscoveryTask(); | 274 task_manager_->PostStopDiscoveryTask(); |
276 } | 275 } |
277 | 276 |
278 } // namespace device | 277 } // namespace device |
OLD | NEW |