Chromium Code Reviews| Index: chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc |
| diff --git a/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc b/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc |
| index 182474e4d2c0a3631a72f1f86e6c2589fb782b6d..1250a24fbebc5c5d025757c274d1acd2fdcb929c 100644 |
| --- a/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc |
| +++ b/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/time/time.h" |
| #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
| #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" |
| +#include "chrome/browser/chromeos/profiles/profile_helper.h" |
|
xiyuan
2016/12/07 17:34:38
nit: remove since no longer used?
afakhry
2016/12/07 17:49:05
Done.
|
| #include "chrome/common/url_constants.h" |
| #include "components/google/core/browser/google_util.h" |
| #include "components/user_manager/user_manager.h" |
| @@ -184,4 +185,27 @@ bool ShouldDelayUrl(const GURL& url) { |
| google_util::ALLOW_SUBDOMAIN); |
| } |
| +bool IsSessionRestorePending(Profile* profile) { |
| + if (!profile) |
| + return false; |
| + |
| + chromeos::OAuth2LoginManager* login_manager = |
| + chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile( |
| + profile); |
| + bool pending_session_restore = false; |
| + if (login_manager) { |
| + switch (login_manager->state()) { |
| + case chromeos::OAuth2LoginManager::SESSION_RESTORE_PREPARING: |
| + case chromeos::OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS: |
| + pending_session_restore = true; |
| + break; |
| + |
| + default: |
| + break; |
| + } |
| + } |
| + |
| + return pending_session_restore; |
| +} |
| + |
| } // namespace merge_session_throttling_utils |