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

Side by Side Diff: components/signin/core/browser/signin_manager.cc

Issue 1117453002: Add gaia_id to ProfileInfoCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments Created 5 years, 7 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
« no previous file with comments | « components/signin/core/browser/signin_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/signin/core/browser/signin_manager.h" 5 #include "components/signin/core/browser/signin_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 possibly_invalid_gaia_id_ = info.gaia; 353 possibly_invalid_gaia_id_ = info.gaia;
354 possibly_invalid_email_ = info.email; 354 possibly_invalid_email_ = info.email;
355 OnSignedIn(); 355 OnSignedIn();
356 } 356 }
357 357
358 void SigninManager::OnSignedIn() { 358 void SigninManager::OnSignedIn() {
359 client_->GetPrefs()->SetInt64(prefs::kSignedInTime, 359 client_->GetPrefs()->SetInt64(prefs::kSignedInTime,
360 base::Time::Now().ToInternalValue()); 360 base::Time::Now().ToInternalValue());
361 SetAuthenticatedAccountInfo(possibly_invalid_gaia_id_, 361 SetAuthenticatedAccountInfo(possibly_invalid_gaia_id_,
362 possibly_invalid_email_); 362 possibly_invalid_email_);
363 const std::string gaia_id = possibly_invalid_gaia_id_;
364
363 possibly_invalid_account_id_.clear(); 365 possibly_invalid_account_id_.clear();
364 possibly_invalid_gaia_id_.clear(); 366 possibly_invalid_gaia_id_.clear();
365 possibly_invalid_email_.clear(); 367 possibly_invalid_email_.clear();
366 signin_manager_signed_in_ = true; 368 signin_manager_signed_in_ = true;
367 369
368 FOR_EACH_OBSERVER( 370 FOR_EACH_OBSERVER(
369 SigninManagerBase::Observer, 371 SigninManagerBase::Observer,
370 observer_list_, 372 observer_list_,
371 GoogleSigninSucceeded(GetAuthenticatedAccountId(), 373 GoogleSigninSucceeded(GetAuthenticatedAccountId(),
372 GetAuthenticatedUsername(), 374 GetAuthenticatedUsername(),
373 password_)); 375 password_));
374 376
375 client_->OnSignedIn(GetAuthenticatedAccountId(), 377 client_->OnSignedIn(GetAuthenticatedAccountId(),
378 gaia_id,
376 GetAuthenticatedUsername(), 379 GetAuthenticatedUsername(),
377 password_); 380 password_);
378 381
379 signin_metrics::LogSigninProfile(client_->IsFirstRun(), 382 signin_metrics::LogSigninProfile(client_->IsFirstRun(),
380 client_->GetInstallDate()); 383 client_->GetInstallDate());
381 384
382 DisableOneClickSignIn(client_->GetPrefs()); // Don't ever offer again. 385 DisableOneClickSignIn(client_->GetPrefs()); // Don't ever offer again.
383 386
384 PostSignedIn(); 387 PostSignedIn();
385 } 388 }
(...skipping 17 matching lines...) Expand all
403 void SigninManager::OnAccountUpdateFailed(const std::string& account_id) { 406 void SigninManager::OnAccountUpdateFailed(const std::string& account_id) {
404 user_info_fetched_by_account_tracker_ = true; 407 user_info_fetched_by_account_tracker_ = true;
405 PostSignedIn(); 408 PostSignedIn();
406 } 409 }
407 410
408 void SigninManager::ProhibitSignout(bool prohibit_signout) { 411 void SigninManager::ProhibitSignout(bool prohibit_signout) {
409 prohibit_signout_ = prohibit_signout; 412 prohibit_signout_ = prohibit_signout;
410 } 413 }
411 414
412 bool SigninManager::IsSignoutProhibited() const { return prohibit_signout_; } 415 bool SigninManager::IsSignoutProhibited() const { return prohibit_signout_; }
OLDNEW
« no previous file with comments | « components/signin/core/browser/signin_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698