Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_get_keys_operation.cc

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698