| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 weak_ptr_factory_(this) { | 46 weak_ptr_factory_(this) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 BluetoothAdapterWin::~BluetoothAdapterWin() { | 49 BluetoothAdapterWin::~BluetoothAdapterWin() { |
| 50 if (task_manager_.get()) { | 50 if (task_manager_.get()) { |
| 51 task_manager_->RemoveObserver(this); | 51 task_manager_->RemoveObserver(this); |
| 52 task_manager_->Shutdown(); | 52 task_manager_->Shutdown(); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 void BluetoothAdapterWin::AddObserver(BluetoothAdapter::Observer* observer) { | |
| 57 DCHECK(observer); | |
| 58 observers_.AddObserver(observer); | |
| 59 } | |
| 60 | |
| 61 void BluetoothAdapterWin::RemoveObserver(BluetoothAdapter::Observer* observer) { | |
| 62 DCHECK(observer); | |
| 63 observers_.RemoveObserver(observer); | |
| 64 } | |
| 65 | |
| 66 std::string BluetoothAdapterWin::GetAddress() const { | 56 std::string BluetoothAdapterWin::GetAddress() const { |
| 67 return address_; | 57 return address_; |
| 68 } | 58 } |
| 69 | 59 |
| 70 std::string BluetoothAdapterWin::GetName() const { | 60 std::string BluetoothAdapterWin::GetName() const { |
| 71 return name_; | 61 return name_; |
| 72 } | 62 } |
| 73 | 63 |
| 74 void BluetoothAdapterWin::SetName(const std::string& name, | 64 void BluetoothAdapterWin::SetName(const std::string& name, |
| 75 const base::Closure& callback, | 65 const base::Closure& callback, |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); | 364 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); |
| 375 on_stop_discovery_callbacks_.clear(); | 365 on_stop_discovery_callbacks_.clear(); |
| 376 return; | 366 return; |
| 377 } | 367 } |
| 378 | 368 |
| 379 discovery_status_ = DISCOVERY_STOPPING; | 369 discovery_status_ = DISCOVERY_STOPPING; |
| 380 task_manager_->PostStopDiscoveryTask(); | 370 task_manager_->PostStopDiscoveryTask(); |
| 381 } | 371 } |
| 382 | 372 |
| 383 } // namespace device | 373 } // namespace device |
| OLD | NEW |