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> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 EasyUnlockGetKeysOperation::~EasyUnlockGetKeysOperation() { | 29 EasyUnlockGetKeysOperation::~EasyUnlockGetKeysOperation() { |
30 } | 30 } |
31 | 31 |
32 void EasyUnlockGetKeysOperation::Start() { | 32 void EasyUnlockGetKeysOperation::Start() { |
33 // TODO(xiyuan): Use ListKeyEx. | 33 // TODO(xiyuan): Use ListKeyEx. |
34 key_index_ = 0; | 34 key_index_ = 0; |
35 GetKeyData(); | 35 GetKeyData(); |
36 } | 36 } |
37 | 37 |
38 void EasyUnlockGetKeysOperation::GetKeyData() { | 38 void EasyUnlockGetKeysOperation::GetKeyData() { |
39 const std::string canonicalized = | 39 const cryptohome::Identification id(user_context_.GetAccountId()); |
40 gaia::CanonicalizeEmail(user_context_.GetAccountId().GetUserEmail()); | |
41 cryptohome::Identification id(canonicalized); | |
42 cryptohome::HomedirMethods::GetInstance()->GetKeyDataEx( | 40 cryptohome::HomedirMethods::GetInstance()->GetKeyDataEx( |
43 id, | 41 id, |
44 EasyUnlockKeyManager::GetKeyLabel(key_index_), | 42 EasyUnlockKeyManager::GetKeyLabel(key_index_), |
45 base::Bind(&EasyUnlockGetKeysOperation::OnGetKeyData, | 43 base::Bind(&EasyUnlockGetKeysOperation::OnGetKeyData, |
46 weak_ptr_factory_.GetWeakPtr())); | 44 weak_ptr_factory_.GetWeakPtr())); |
47 | 45 |
48 } | 46 } |
49 | 47 |
50 void EasyUnlockGetKeysOperation::OnGetKeyData( | 48 void EasyUnlockGetKeysOperation::OnGetKeyData( |
51 bool success, | 49 bool success, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 << entry.name; | 115 << entry.name; |
118 } | 116 } |
119 } | 117 } |
120 devices_.push_back(device); | 118 devices_.push_back(device); |
121 | 119 |
122 ++key_index_; | 120 ++key_index_; |
123 GetKeyData(); | 121 GetKeyData(); |
124 } | 122 } |
125 | 123 |
126 } // namespace chromeos | 124 } // namespace chromeos |
OLD | NEW |