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 "chrome/browser/chromeos/login/easy_unlock/easy_unlock_get_keys_operati
on.h" | 5 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_get_keys_operati
on.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <vector> | 9 #include <vector> |
8 | 10 |
9 #include "base/bind.h" | 11 #include "base/bind.h" |
10 #include "base/logging.h" | 12 #include "base/logging.h" |
11 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 13 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
12 #include "components/proximity_auth/logging/logging.h" | 14 #include "components/proximity_auth/logging/logging.h" |
13 #include "components/signin/core/account_id/account_id.h" | 15 #include "components/signin/core/account_id/account_id.h" |
14 #include "google_apis/gaia/gaia_auth_util.h" | 16 #include "google_apis/gaia/gaia_auth_util.h" |
15 | 17 |
16 namespace chromeos { | 18 namespace chromeos { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 for (size_t i = 0; i < provider_data.size(); ++i) { | 74 for (size_t i = 0; i < provider_data.size(); ++i) { |
73 const cryptohome::KeyDefinition::ProviderData& entry = provider_data[i]; | 75 const cryptohome::KeyDefinition::ProviderData& entry = provider_data[i]; |
74 if (entry.name == kEasyUnlockKeyMetaNameBluetoothAddress) { | 76 if (entry.name == kEasyUnlockKeyMetaNameBluetoothAddress) { |
75 if (entry.bytes) | 77 if (entry.bytes) |
76 device.bluetooth_address = *entry.bytes; | 78 device.bluetooth_address = *entry.bytes; |
77 else | 79 else |
78 NOTREACHED(); | 80 NOTREACHED(); |
79 } else if (entry.name == kEasyUnlockKeyMetaNameBluetoothType) { | 81 } else if (entry.name == kEasyUnlockKeyMetaNameBluetoothType) { |
80 if (entry.number) { | 82 if (entry.number) { |
81 if (*entry.number >= | 83 if (*entry.number >= |
82 static_cast<int64>(EasyUnlockDeviceKeyData::NUM_BLUETOOTH_TYPES)) { | 84 static_cast<int64_t>( |
| 85 EasyUnlockDeviceKeyData::NUM_BLUETOOTH_TYPES)) { |
83 PA_LOG(ERROR) << "Invalid Bluetooth type: " << *entry.number; | 86 PA_LOG(ERROR) << "Invalid Bluetooth type: " << *entry.number; |
84 } else { | 87 } else { |
85 device.bluetooth_type = | 88 device.bluetooth_type = |
86 static_cast<EasyUnlockDeviceKeyData::BluetoothType>( | 89 static_cast<EasyUnlockDeviceKeyData::BluetoothType>( |
87 *entry.number); | 90 *entry.number); |
88 } | 91 } |
89 } else { | 92 } else { |
90 NOTREACHED(); | 93 NOTREACHED(); |
91 } | 94 } |
92 } else if (entry.name == kEasyUnlockKeyMetaNamePubKey) { | 95 } else if (entry.name == kEasyUnlockKeyMetaNamePubKey) { |
(...skipping 21 matching lines...) Expand all Loading... |
114 << entry.name; | 117 << entry.name; |
115 } | 118 } |
116 } | 119 } |
117 devices_.push_back(device); | 120 devices_.push_back(device); |
118 | 121 |
119 ++key_index_; | 122 ++key_index_; |
120 GetKeyData(); | 123 GetKeyData(); |
121 } | 124 } |
122 | 125 |
123 } // namespace chromeos | 126 } // namespace chromeos |
OLD | NEW |