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

Unified Diff: chrome/browser/chromeos/login/oauth2_login_manager.h

Issue 148463004: Perform /ListAccounts check before session merge to see if there is a need for session merge at all. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/oauth2_login_manager.h
diff --git a/chrome/browser/chromeos/login/oauth2_login_manager.h b/chrome/browser/chromeos/login/oauth2_login_manager.h
index 56482bee5e973daa5351c21c1f722688e0f5e18f..f8d37936bcc89d4ea6532103a1ef57b201eb3d11 100644
--- a/chrome/browser/chromeos/login/oauth2_login_manager.h
+++ b/chrome/browser/chromeos/login/oauth2_login_manager.h
@@ -115,22 +115,24 @@ class OAuth2LoginManager : public BrowserContextKeyedService,
private:
friend class MergeSessionLoadPageTest;
+ friend class OAuth2Test;
// Session restore outcomes (for UMA).
- enum {
+ enum SessionRestoreOutcome {
SESSION_RESTORE_UNDEFINED = 0,
SESSION_RESTORE_SUCCESS = 1,
SESSION_RESTORE_TOKEN_FETCH_FAILED = 2,
SESSION_RESTORE_NO_REFRESH_TOKEN_FAILED = 3,
SESSION_RESTORE_OAUTHLOGIN_FAILED = 4,
SESSION_RESTORE_MERGE_SESSION_FAILED = 5,
- SESSION_RESTORE_COUNT = SESSION_RESTORE_MERGE_SESSION_FAILED,
+ SESSION_RESTORE_NOT_NEEDED = 6,
+ SESSION_RESTORE_COUNT = 7,
};
// Outcomes of post-merge session verification.
// This enum is used for an UMA histogram, and hence new items should only be
// appended at the end.
- enum PostMergeVerificationOutcome {
+ enum MergeVerificationOutcome {
POST_MERGE_UNDEFINED = 0,
POST_MERGE_SUCCESS = 1,
POST_MERGE_NO_ACCOUNTS = 2,
@@ -188,6 +190,10 @@ class OAuth2LoginManager : public BrowserContextKeyedService,
// Reports when all tokens are loaded.
void ReportOAuth2TokensLoaded();
+ // Checks if primary account sessions cookies are stale and restores them
+ // if needed.
+ void VerifySessionCookies();
+
// Issue GAIA cookie recovery (MergeSession) from |refresh_token_|.
void RestoreSessionCookies();
@@ -201,8 +207,14 @@ class OAuth2LoginManager : public BrowserContextKeyedService,
// Testing helper.
void SetSessionRestoreStartForTesting(const base::Time& time);
- // Records |outcome| of post merge verification check.
- static void RecordPostMergeOutcome(PostMergeVerificationOutcome outcome);
+ // Records |outcome| of merge verification check. |is_pre_merge| specifies
+ // if this is pre or post merge session verification.
+ static void RecordCookiesCheckOutcome(
+ bool is_pre_merge,
+ MergeVerificationOutcome outcome);
+
+ // Records successful |outcome| of merge session process.
+ void RecordSessionRestoreOutcome(SessionRestoreOutcome outcome);
// Keeps the track if we have already reported OAuth2 token being loaded
// by OAuth2TokenService.

Powered by Google App Engine
This is Rietveld 408576698