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

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

Issue 11817045: Move auth-error reporting code out of SyncGlobalError and into SigninGlobalError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabled ExtensionActionContextMenuTest.BrowserAction Created 7 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
« no previous file with comments | « chrome/browser/defaults.cc ('k') | chrome/browser/signin/oauth2_token_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/oauth2_token_service.h
diff --git a/chrome/browser/signin/oauth2_token_service.h b/chrome/browser/signin/oauth2_token_service.h
index 2ba0fb6feb433dea69e0499be9f183fe27d51c46..3f19b3c0817954e516767854af99d7beceb27cc1 100644
--- a/chrome/browser/signin/oauth2_token_service.h
+++ b/chrome/browser/signin/oauth2_token_service.h
@@ -14,6 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "base/time.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
+#include "chrome/browser/signin/signin_global_error.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "net/url_request/url_request_context_getter.h"
@@ -46,6 +47,7 @@ class Profile;
// Note the request should be started from the UI thread. To start a request
// from other thread, please use OAuth2TokenServiceRequest.
class OAuth2TokenService : public content::NotificationObserver,
+ public SigninGlobalError::AuthStatusProvider,
public ProfileKeyedService {
public:
// Class representing a request that fetches an OAuth2 access token.
@@ -80,6 +82,9 @@ class OAuth2TokenService : public content::NotificationObserver,
// Initializes this token service with the profile.
void Initialize(Profile* profile);
+ // ProfileKeyedService implementation.
+ virtual void Shutdown() OVERRIDE;
+
// Starts a request for an OAuth2 access token using the OAuth2 refresh token
// maintained by TokenService. The caller owns the returned Request. |scopes|
// is the set of scopes to get an access token for, |consumer| is the object
@@ -99,6 +104,9 @@ class OAuth2TokenService : public content::NotificationObserver,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // SigninGlobalError::AuthStatusProvider implementation.
+ virtual GoogleServiceAuthError GetAuthStatus() const OVERRIDE;
+
private:
// Class that fetches an OAuth2 access token for a given set of scopes and
// OAuth2 refresh token.
@@ -135,9 +143,16 @@ class OAuth2TokenService : public content::NotificationObserver,
// Called when |fetcher| finishes fetching.
void OnFetchComplete(Fetcher* fetcher);
+ // Updates the internal cache of the result from the most-recently-completed
+ // auth request (used for reporting errors to the user).
+ void UpdateAuthError(const GoogleServiceAuthError& error);
+
// The profile with which this instance was initialized, or NULL.
Profile* profile_;
+ // The auth status from the most-recently-completed request.
+ GoogleServiceAuthError last_auth_error_;
+
// Getter to use for fetchers.
scoped_refptr<net::URLRequestContextGetter> getter_;
« no previous file with comments | « chrome/browser/defaults.cc ('k') | chrome/browser/signin/oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698