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 "chrome/browser/metrics/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 paired_device->set_type(AsBluetoothDeviceType(device->GetDeviceType())); | 964 paired_device->set_type(AsBluetoothDeviceType(device->GetDeviceType())); |
965 | 965 |
966 // address is xx:xx:xx:xx:xx:xx, extract the first three components and | 966 // address is xx:xx:xx:xx:xx:xx, extract the first three components and |
967 // pack into a uint32 | 967 // pack into a uint32 |
968 std::string address = device->GetAddress(); | 968 std::string address = device->GetAddress(); |
969 if (address.size() > 9 && | 969 if (address.size() > 9 && |
970 address[2] == ':' && address[5] == ':' && address[8] == ':') { | 970 address[2] == ':' && address[5] == ':' && address[8] == ':') { |
971 std::string vendor_prefix_str; | 971 std::string vendor_prefix_str; |
972 uint64 vendor_prefix; | 972 uint64 vendor_prefix; |
973 | 973 |
974 RemoveChars(address.substr(0, 9), ":", &vendor_prefix_str); | 974 base::RemoveChars(address.substr(0, 9), ":", &vendor_prefix_str); |
975 DCHECK_EQ(6U, vendor_prefix_str.size()); | 975 DCHECK_EQ(6U, vendor_prefix_str.size()); |
976 base::HexStringToUInt64(vendor_prefix_str, &vendor_prefix); | 976 base::HexStringToUInt64(vendor_prefix_str, &vendor_prefix); |
977 | 977 |
978 paired_device->set_vendor_prefix(vendor_prefix); | 978 paired_device->set_vendor_prefix(vendor_prefix); |
979 } | 979 } |
980 | 980 |
981 paired_device->set_vendor_id(device->GetVendorID()); | 981 paired_device->set_vendor_id(device->GetVendorID()); |
982 paired_device->set_product_id(device->GetProductID()); | 982 paired_device->set_product_id(device->GetProductID()); |
983 paired_device->set_device_id(device->GetDeviceID()); | 983 paired_device->set_device_id(device->GetDeviceID()); |
984 } | 984 } |
(...skipping 10 matching lines...) Expand all Loading... |
995 | 995 |
996 // We invalidate the user count if it changed while the log was open. | 996 // We invalidate the user count if it changed while the log was open. |
997 if (system_profile->has_multi_profile_user_count() && | 997 if (system_profile->has_multi_profile_user_count() && |
998 user_count != system_profile->multi_profile_user_count()) | 998 user_count != system_profile->multi_profile_user_count()) |
999 user_count = 0; | 999 user_count = 0; |
1000 | 1000 |
1001 system_profile->set_multi_profile_user_count(user_count); | 1001 system_profile->set_multi_profile_user_count(user_count); |
1002 } | 1002 } |
1003 } | 1003 } |
1004 #endif | 1004 #endif |
OLD | NEW |