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

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

Issue 2529103002: Add account_type into AccountId (Closed)
Patch Set: Created 4 years 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/bootstrap_user_context_initi alizer.h" 5 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_context_initi alizer.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 std::string email; 171 std::string email;
172 std::string gaia_id; 172 std::string gaia_id;
173 if (!user_info->GetString("email", &email) || 173 if (!user_info->GetString("email", &email) ||
174 !user_info->GetString("id", &gaia_id)) { 174 !user_info->GetString("id", &gaia_id)) {
175 LOG(ERROR) << "Bad user info."; 175 LOG(ERROR) << "Bad user info.";
176 Notify(false); 176 Notify(false);
177 return; 177 return;
178 } 178 }
179 179
180 user_context_.SetAccountId(user_manager::known_user::GetAccountId( 180 user_context_.SetAccountId(user_manager::known_user::GetAccountId(
181 user_manager::CanonicalizeUserID(email), gaia_id)); 181 user_manager::CanonicalizeUserID(email), gaia_id,
182 std::string() /* account_type */));
182 StartCheckExistingKeys(); 183 StartCheckExistingKeys();
183 } 184 }
184 185
185 void BootstrapUserContextInitializer::OnOAuthError() { 186 void BootstrapUserContextInitializer::OnOAuthError() {
186 LOG(ERROR) << "Auth error."; 187 LOG(ERROR) << "Auth error.";
187 Notify(false); 188 Notify(false);
188 } 189 }
189 190
190 void BootstrapUserContextInitializer::OnNetworkError(int response_code) { 191 void BootstrapUserContextInitializer::OnNetworkError(int response_code) {
191 LOG(ERROR) << "Network error."; 192 LOG(ERROR) << "Network error.";
(...skipping 11 matching lines...) Expand all
203 EasyUnlockService::Get(ProfileHelper::GetSigninProfile()); 204 EasyUnlockService::Get(ProfileHelper::GetSigninProfile());
204 service->RemoveObserver(this); 205 service->RemoveObserver(this);
205 206
206 service->AttemptAuth( 207 service->AttemptAuth(
207 user_context_.GetAccountId(), 208 user_context_.GetAccountId(),
208 base::Bind(&BootstrapUserContextInitializer::OnEasyUnlockAuthenticated, 209 base::Bind(&BootstrapUserContextInitializer::OnEasyUnlockAuthenticated,
209 weak_ptr_factory_.GetWeakPtr())); 210 weak_ptr_factory_.GetWeakPtr()));
210 } 211 }
211 212
212 } // namespace chromeos 213 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698