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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2752873002: Fix refresh token is not available after Chrome restart on crash. (Closed)
Patch Set: UMA added Created 3 years, 9 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 | « no previous file | components/signin/core/browser/signin_manager_base.cc » ('j') | 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 "chrome/browser/chromeos/login/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 // user_id (kStubUser) and certain services like restoring OAuth session are 541 // user_id (kStubUser) and certain services like restoring OAuth session are
542 // explicitly disabled for it. 542 // explicitly disabled for it.
543 if (!user_manager->IsUserLoggedIn() || 543 if (!user_manager->IsUserLoggedIn() ||
544 !user_manager->IsLoggedInAsUserWithGaiaAccount() || 544 !user_manager->IsLoggedInAsUserWithGaiaAccount() ||
545 user_manager->IsLoggedInAsStub()) { 545 user_manager->IsLoggedInAsStub()) {
546 return; 546 return;
547 } 547 }
548 548
549 const user_manager::User* user = 549 const user_manager::User* user =
550 ProfileHelper::Get()->GetUserByProfile(user_profile); 550 ProfileHelper::Get()->GetUserByProfile(user_profile);
551
552 const SigninManagerBase* signin_manager =
553 SigninManagerFactory::GetForProfile(user_profile);
554 const bool account_id_valid =
555 signin_manager && !signin_manager->GetAuthenticatedAccountId().empty();
556 if (!account_id_valid)
557 LOG(ERROR) << "No account is associated with sign-in manager on restore.";
558 UMA_HISTOGRAM_BOOLEAN("UserSessionManager.RestoreOnCrash.AccountIdValid",
559 account_id_valid);
560
551 DCHECK(user); 561 DCHECK(user);
552 if (!net::NetworkChangeNotifier::IsOffline()) { 562 if (!net::NetworkChangeNotifier::IsOffline()) {
553 pending_signin_restore_sessions_.erase(user->GetAccountId().GetUserEmail()); 563 pending_signin_restore_sessions_.erase(user->GetAccountId().GetUserEmail());
554 RestoreAuthSessionImpl(user_profile, false /* has_auth_cookies */); 564 RestoreAuthSessionImpl(user_profile, false /* has_auth_cookies */);
555 } else { 565 } else {
556 // Even if we're online we should wait till initial 566 // Even if we're online we should wait till initial
557 // OnConnectionTypeChanged() call. Otherwise starting fetchers too early may 567 // OnConnectionTypeChanged() call. Otherwise starting fetchers too early may
558 // end up canceling all request when initial network connection type is 568 // end up canceling all request when initial network connection type is
559 // processed. See http://crbug.com/121643. 569 // processed. See http://crbug.com/121643.
560 pending_signin_restore_sessions_.insert( 570 pending_signin_restore_sessions_.insert(
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 ->browser_policy_connector_chromeos() 1924 ->browser_policy_connector_chromeos()
1915 ->IsEnterpriseManaged()) { 1925 ->IsEnterpriseManaged()) {
1916 return false; 1926 return false;
1917 } 1927 }
1918 1928
1919 // Do not show end of life notification if this is a guest session 1929 // Do not show end of life notification if this is a guest session
1920 return !profile->IsGuestSession(); 1930 return !profile->IsGuestSession();
1921 } 1931 }
1922 1932
1923 } // namespace chromeos 1933 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | components/signin/core/browser/signin_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698