| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_chromeos.h" | 5 #include "device/bluetooth/bluetooth_adapter_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 BluetoothAdapterChromeOS::~BluetoothAdapterChromeOS() { | 137 BluetoothAdapterChromeOS::~BluetoothAdapterChromeOS() { |
| 138 Shutdown(); | 138 Shutdown(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void BluetoothAdapterChromeOS::DeleteOnCorrectThread() const { | 141 void BluetoothAdapterChromeOS::DeleteOnCorrectThread() const { |
| 142 if (ui_task_runner_->RunsTasksOnCurrentThread() || | 142 if (ui_task_runner_->RunsTasksOnCurrentThread() || |
| 143 !ui_task_runner_->DeleteSoon(FROM_HERE, this)) | 143 !ui_task_runner_->DeleteSoon(FROM_HERE, this)) |
| 144 delete this; | 144 delete this; |
| 145 } | 145 } |
| 146 | 146 |
| 147 void BluetoothAdapterChromeOS::AddObserver( | |
| 148 BluetoothAdapter::Observer* observer) { | |
| 149 DCHECK(observer); | |
| 150 observers_.AddObserver(observer); | |
| 151 } | |
| 152 | |
| 153 void BluetoothAdapterChromeOS::RemoveObserver( | |
| 154 BluetoothAdapter::Observer* observer) { | |
| 155 DCHECK(observer); | |
| 156 observers_.RemoveObserver(observer); | |
| 157 } | |
| 158 | |
| 159 std::string BluetoothAdapterChromeOS::GetAddress() const { | 147 std::string BluetoothAdapterChromeOS::GetAddress() const { |
| 160 if (!IsPresent()) | 148 if (!IsPresent()) |
| 161 return std::string(); | 149 return std::string(); |
| 162 | 150 |
| 163 BluetoothAdapterClient::Properties* properties = | 151 BluetoothAdapterClient::Properties* properties = |
| 164 DBusThreadManager::Get()->GetBluetoothAdapterClient()-> | 152 DBusThreadManager::Get()->GetBluetoothAdapterClient()-> |
| 165 GetProperties(object_path_); | 153 GetProperties(object_path_); |
| 166 DCHECK(properties); | 154 DCHECK(properties); |
| 167 | 155 |
| 168 return BluetoothDevice::CanonicalizeAddress(properties->address.value()); | 156 return BluetoothDevice::CanonicalizeAddress(properties->address.value()); |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 | 1409 |
| 1422 // If the queued request resulted in a pending call, then let it | 1410 // If the queued request resulted in a pending call, then let it |
| 1423 // asynchonously process the remaining queued requests once the pending | 1411 // asynchonously process the remaining queued requests once the pending |
| 1424 // call returns. | 1412 // call returns. |
| 1425 if (discovery_request_pending_) | 1413 if (discovery_request_pending_) |
| 1426 return; | 1414 return; |
| 1427 } | 1415 } |
| 1428 } | 1416 } |
| 1429 | 1417 |
| 1430 } // namespace chromeos | 1418 } // namespace chromeos |
| OLD | NEW |