| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/bluetooth/bluetooth_private_api.h" | 5 #include "extensions/browser/api/bluetooth/bluetooth_private_api.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 void BluetoothPrivateSetAdapterStateFunction::SendError() { | 220 void BluetoothPrivateSetAdapterStateFunction::SendError() { |
| 221 DCHECK(pending_properties_.empty()); | 221 DCHECK(pending_properties_.empty()); |
| 222 DCHECK(!failed_properties_.empty()); | 222 DCHECK(!failed_properties_.empty()); |
| 223 | 223 |
| 224 std::vector<std::string> failed_vector; | 224 std::vector<std::string> failed_vector; |
| 225 std::copy(failed_properties_.begin(), | 225 std::copy(failed_properties_.begin(), |
| 226 failed_properties_.end(), | 226 failed_properties_.end(), |
| 227 std::back_inserter(failed_vector)); | 227 std::back_inserter(failed_vector)); |
| 228 | 228 |
| 229 std::vector<std::string> replacements(1); | 229 std::vector<std::string> replacements(1); |
| 230 replacements[0] = base::JoinString(failed_vector, ", "); | 230 replacements[0] = JoinString(failed_vector, ", "); |
| 231 std::string error = | 231 std::string error = |
| 232 ReplaceStringPlaceholders(kSetAdapterPropertyError, replacements, NULL); | 232 ReplaceStringPlaceholders(kSetAdapterPropertyError, replacements, NULL); |
| 233 SetError(error); | 233 SetError(error); |
| 234 SendResponse(false); | 234 SendResponse(false); |
| 235 } | 235 } |
| 236 | 236 |
| 237 BluetoothPrivateSetPairingResponseFunction:: | 237 BluetoothPrivateSetPairingResponseFunction:: |
| 238 BluetoothPrivateSetPairingResponseFunction() {} | 238 BluetoothPrivateSetPairingResponseFunction() {} |
| 239 | 239 |
| 240 BluetoothPrivateSetPairingResponseFunction:: | 240 BluetoothPrivateSetPairingResponseFunction:: |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 this), | 411 this), |
| 412 base::Bind( | 412 base::Bind( |
| 413 &BluetoothPrivateSetDiscoveryFilterFunction::OnErrorCallback, | 413 &BluetoothPrivateSetDiscoveryFilterFunction::OnErrorCallback, |
| 414 this)); | 414 this)); |
| 415 return true; | 415 return true; |
| 416 } | 416 } |
| 417 | 417 |
| 418 } // namespace core_api | 418 } // namespace core_api |
| 419 | 419 |
| 420 } // namespace extensions | 420 } // namespace extensions |
| OLD | NEW |