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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 EasyUnlockGetKeysOperation::~EasyUnlockGetKeysOperation() { | 25 EasyUnlockGetKeysOperation::~EasyUnlockGetKeysOperation() { |
26 } | 26 } |
27 | 27 |
28 void EasyUnlockGetKeysOperation::Start() { | 28 void EasyUnlockGetKeysOperation::Start() { |
29 // TODO(xiyuan): Use ListKeyEx. | 29 // TODO(xiyuan): Use ListKeyEx. |
30 key_index_ = 0; | 30 key_index_ = 0; |
31 GetKeyData(); | 31 GetKeyData(); |
32 } | 32 } |
33 | 33 |
34 void EasyUnlockGetKeysOperation::GetKeyData() { | 34 void EasyUnlockGetKeysOperation::GetKeyData() { |
35 std::string canonicalized = | 35 user_manager::UserID user_id(user_context_.GetUserID()); |
36 gaia::CanonicalizeEmail(user_context_.GetUserID()); | 36 user_id.SetUserEmail(gaia::CanonicalizeEmail(user_id.GetUserEmail())); |
37 cryptohome::Identification id(canonicalized); | 37 cryptohome::Identification id(user_id); |
38 cryptohome::HomedirMethods::GetInstance()->GetKeyDataEx( | 38 cryptohome::HomedirMethods::GetInstance()->GetKeyDataEx( |
39 id, | 39 id, |
40 EasyUnlockKeyManager::GetKeyLabel(key_index_), | 40 EasyUnlockKeyManager::GetKeyLabel(key_index_), |
41 base::Bind(&EasyUnlockGetKeysOperation::OnGetKeyData, | 41 base::Bind(&EasyUnlockGetKeysOperation::OnGetKeyData, |
42 weak_ptr_factory_.GetWeakPtr())); | 42 weak_ptr_factory_.GetWeakPtr())); |
43 | 43 |
44 } | 44 } |
45 | 45 |
46 void EasyUnlockGetKeysOperation::OnGetKeyData( | 46 void EasyUnlockGetKeysOperation::OnGetKeyData( |
47 bool success, | 47 bool success, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 << entry.name; | 99 << entry.name; |
100 } | 100 } |
101 } | 101 } |
102 devices_.push_back(device); | 102 devices_.push_back(device); |
103 | 103 |
104 ++key_index_; | 104 ++key_index_; |
105 GetKeyData(); | 105 GetKeyData(); |
106 } | 106 } |
107 | 107 |
108 } // namespace chromeos | 108 } // namespace chromeos |
OLD | NEW |