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

Unified Diff: chrome/browser/signin/signin_tracker.h

Issue 19567004: Convert SigninTracker to use OAuth2TokenService notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/signin/signin_tracker.cc » ('j') | chrome/browser/signin/signin_tracker.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/signin_tracker.h
diff --git a/chrome/browser/signin/signin_tracker.h b/chrome/browser/signin/signin_tracker.h
index 64bd8ab8a642490a8ca452a075ba0a6f43d8d7f8..3dbaaa1395c3db33418a7ea0aa1ca14cd9dcef22 100644
--- a/chrome/browser/signin/signin_tracker.h
+++ b/chrome/browser/signin/signin_tracker.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_
#define CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_H_
+#include "chrome/browser/signin/oauth2_token_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_types.h"
@@ -16,11 +17,11 @@ class Profile;
// responsibilities:
//
// SigninTracker (this class) - This class listens to notifications from various
-// services (SigninManager, tokenService, etc) and coalesces them into
+// services (SigninManager, OAuth2TokenService) and coalesces them into
// notifications for the UI layer. This is the class that encapsulates the logic
// that determines whether a user is fully logged in or not, and exposes
-// callbacks so various pieces of the UI (OneClickSyncStarter, SyncSetupHandler)
-// can track the current startup state.
+// callbacks so various pieces of the UI (OneClickSyncStarter) can track the
+// current startup state.
//
// SyncSetupHandler - This class is primarily responsible for interacting with
// the web UI for performing system login and sync configuration. Receives
@@ -41,11 +42,15 @@ class Profile;
// TokenService - Uses credentials provided by SigninManager to generate tokens
// for all signed-in services in Chrome.
//
+// OAuth2TokenService - Maintains and manages OAuth2 tokens for the accounts
+// connected to this profile.
+//
// ProfileSyncService - Provides the external API for interacting with the
// sync framework. Listens for notifications from the TokenService to know
// when to startup sync, and provides an Observer interface to notify the UI
// layer of changes in sync state so they can be reflected in the UI.
-class SigninTracker : public content::NotificationObserver {
+class SigninTracker : public content::NotificationObserver,
+ public OAuth2TokenService::Observer {
public:
class Observer {
public:
@@ -74,6 +79,12 @@ class SigninTracker : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // OAuth2TokenService::Observer implementation.
+ virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE;
+ virtual void OnRefreshTokenRevoked(
+ const std::string& account_id,
+ const GoogleServiceAuthError& error) OVERRIDE;
+
// Returns true if the tokens are loaded for all signed-in services.
static bool AreServiceTokensLoaded(Profile* profile);
« no previous file with comments | « no previous file | chrome/browser/signin/signin_tracker.cc » ('j') | chrome/browser/signin/signin_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698