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 "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 Loading... |
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 Loading... |
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_; } |
OLD | NEW |