Chromium Code Reviews| 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_bluez.h" | 5 #include "device/bluetooth/bluetooth_adapter_bluez.h" | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 #include <utility> | 8 #include <utility> | 
| 9 | 9 | 
| 10 #include "base/bind.h" | 10 #include "base/bind.h" | 
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 821 case chromeos::DeviceType::kChromebook: | 821 case chromeos::DeviceType::kChromebook: | 
| 822 alias = "Chromebook"; | 822 alias = "Chromebook"; | 
| 823 break; | 823 break; | 
| 824 case chromeos::DeviceType::kChromebox: | 824 case chromeos::DeviceType::kChromebox: | 
| 825 alias = "Chromebox"; | 825 alias = "Chromebox"; | 
| 826 break; | 826 break; | 
| 827 case chromeos::DeviceType::kUnknown: | 827 case chromeos::DeviceType::kUnknown: | 
| 828 alias = "Chromebook"; | 828 alias = "Chromebook"; | 
| 829 break; | 829 break; | 
| 830 } | 830 } | 
| 831 #elif defined(OS_LINUX) | |
| 832 alias = "ChromeLinux"; | |
| 833 #endif | |
| 834 | |
| 835 // Take the lower 2 bytes of hashed Bluetooth address and combine it with the | 831 // Take the lower 2 bytes of hashed Bluetooth address and combine it with the | 
| 836 // device type to create a more identifiable device name. | 832 // device type to create a more identifiable device name. | 
| 837 const std::string address = GetAddress(); | 833 const std::string address = GetAddress(); | 
| 838 alias = base::StringPrintf( | 834 alias = base::StringPrintf( | 
| 839 "%s_%04X", alias.c_str(), | 835 "%s_%04X", alias.c_str(), | 
| 840 base::SuperFastHash(address.data(), address.size()) & 0xFFFF); | 836 base::SuperFastHash(address.data(), address.size()) & 0xFFFF); | 
| 841 SetName(alias, base::Bind(&base::DoNothing), base::Bind(&base::DoNothing)); | 837 SetName(alias, base::Bind(&base::DoNothing), base::Bind(&base::DoNothing)); | 
| 838 #elif defined(OS_LINUX) | |
| 
 
ortuno
2016/03/30 17:11:57
You are moving this after "SetName" so you might a
 
 | |
| 839 alias = "ChromeLinux"; | |
| 840 #endif | |
| 842 } | 841 } | 
| 843 | 842 | 
| 844 void BluetoothAdapterBlueZ::RemoveAdapter() { | 843 void BluetoothAdapterBlueZ::RemoveAdapter() { | 
| 845 DCHECK(IsPresent()); | 844 DCHECK(IsPresent()); | 
| 846 VLOG(1) << object_path_.value() << ": adapter removed."; | 845 VLOG(1) << object_path_.value() << ": adapter removed."; | 
| 847 | 846 | 
| 848 bluez::BluetoothAdapterClient::Properties* properties = | 847 bluez::BluetoothAdapterClient::Properties* properties = | 
| 849 bluez::BluezDBusManager::Get() | 848 bluez::BluezDBusManager::Get() | 
| 850 ->GetBluetoothAdapterClient() | 849 ->GetBluetoothAdapterClient() | 
| 851 ->GetProperties(object_path_); | 850 ->GetProperties(object_path_); | 
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1404 | 1403 | 
| 1405 // If the queued request resulted in a pending call, then let it | 1404 // If the queued request resulted in a pending call, then let it | 
| 1406 // asynchonously process the remaining queued requests once the pending | 1405 // asynchonously process the remaining queued requests once the pending | 
| 1407 // call returns. | 1406 // call returns. | 
| 1408 if (discovery_request_pending_) | 1407 if (discovery_request_pending_) | 
| 1409 return; | 1408 return; | 
| 1410 } | 1409 } | 
| 1411 } | 1410 } | 
| 1412 | 1411 | 
| 1413 } // namespace bluez | 1412 } // namespace bluez | 
| OLD | NEW |