| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provid
er.h" | 5 #include "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provid
er.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 adapter->AddMockDevice(std::move(device)); | 333 adapter->AddMockDevice(std::move(device)); |
| 334 | 334 |
| 335 return adapter; | 335 return adapter; |
| 336 } | 336 } |
| 337 | 337 |
| 338 // static | 338 // static |
| 339 scoped_refptr<NiceMockBluetoothAdapter> | 339 scoped_refptr<NiceMockBluetoothAdapter> |
| 340 LayoutTestBluetoothAdapterProvider::GetPowerPresenceAdapter( | 340 LayoutTestBluetoothAdapterProvider::GetPowerPresenceAdapter( |
| 341 bool tx_power_present, | 341 bool tx_power_present, |
| 342 bool rssi_present) { | 342 bool rssi_present) { |
| 343 // TODO(ortuno): RSSI Unknown and Tx Power Unknown should have different | |
| 344 // values. Add kUnknownTxPower when implemented: http://crbug.com/551572 | |
| 345 int tx_power = | 343 int tx_power = |
| 346 tx_power_present ? kDefaultTxPower : BluetoothDevice::kUnknownPower; | 344 tx_power_present ? kDefaultTxPower : BluetoothDevice::kUnknownTxPower; |
| 347 int rssi = rssi_present ? kDefaultRssi : BluetoothDevice::kUnknownPower; | 345 int rssi = rssi_present ? kDefaultRssi : BluetoothDevice::kUnknownRSSI; |
| 348 | 346 |
| 349 return GetPowerValueAdapter(tx_power, rssi); | 347 return GetPowerValueAdapter(tx_power, rssi); |
| 350 } | 348 } |
| 351 | 349 |
| 352 // static | 350 // static |
| 353 scoped_refptr<NiceMockBluetoothAdapter> | 351 scoped_refptr<NiceMockBluetoothAdapter> |
| 354 LayoutTestBluetoothAdapterProvider::GetGlucoseHeartRateAdapter() { | 352 LayoutTestBluetoothAdapterProvider::GetGlucoseHeartRateAdapter() { |
| 355 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter()); | 353 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter()); |
| 356 | 354 |
| 357 adapter->AddMockDevice(GetHeartRateDevice(adapter.get())); | 355 adapter->AddMockDevice(GetHeartRateDevice(adapter.get())); |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 return BluetoothUUID(); | 1028 return BluetoothUUID(); |
| 1031 } | 1029 } |
| 1032 | 1030 |
| 1033 // static | 1031 // static |
| 1034 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { | 1032 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { |
| 1035 return BluetoothDevice::CanonicalizeAddress( | 1033 return BluetoothDevice::CanonicalizeAddress( |
| 1036 base::StringPrintf("%012" PRIx64, addr)); | 1034 base::StringPrintf("%012" PRIx64, addr)); |
| 1037 } | 1035 } |
| 1038 | 1036 |
| 1039 } // namespace content | 1037 } // namespace content |
| OLD | NEW |