Index: chrome/browser/extensions/api/identity/identity_api.h |
diff --git a/chrome/browser/extensions/api/identity/identity_api.h b/chrome/browser/extensions/api/identity/identity_api.h |
index 9239ed402bf7ca291878dd4d9515507833bf6eca..a04a01dce7a524d203466aba431e35e17f8735d3 100644 |
--- a/chrome/browser/extensions/api/identity/identity_api.h |
+++ b/chrome/browser/extensions/api/identity/identity_api.h |
@@ -19,10 +19,12 @@ |
#include "chrome/browser/extensions/api/identity/web_auth_flow.h" |
#include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
#include "chrome/browser/extensions/extension_function.h" |
+#include "chrome/browser/signin/oauth2_token_service.h" |
#include "chrome/browser/signin/signin_global_error.h" |
#include "google_apis/gaia/oauth2_mint_token_flow.h" |
class GoogleServiceAuthError; |
+class MockGetAuthTokenFunction; |
class Profile; |
class SigninManagerBase; |
@@ -65,7 +67,8 @@ class IdentityGetAuthTokenFunction : public AsyncExtensionFunction, |
public GaiaWebAuthFlow::Delegate, |
public IdentityMintRequestQueue::Request, |
public OAuth2MintTokenFlow::Delegate, |
- public IdentitySigninFlow::Delegate { |
+ public IdentitySigninFlow::Delegate, |
+ public OAuth2TokenService::Consumer { |
public: |
DECLARE_EXTENSION_FUNCTION("identity.getAuthToken", |
EXPERIMENTAL_IDENTITY_GETAUTHTOKEN); |
@@ -116,6 +119,13 @@ class IdentityGetAuthTokenFunction : public AsyncExtensionFunction, |
virtual void OnGaiaFlowCompleted(const std::string& access_token, |
const std::string& expiration) OVERRIDE; |
+ // OAuth2TokenService::Consumer implementation: |
+ virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
+ const std::string& access_token, |
+ const base::Time& expiration_time) OVERRIDE; |
+ virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
+ const GoogleServiceAuthError& error) OVERRIDE; |
+ |
// Starts a mint token request to GAIA. |
void StartGaiaRequest(OAuth2MintTokenFlow::Mode mode); |
@@ -147,6 +157,7 @@ class IdentityGetAuthTokenFunction : public AsyncExtensionFunction, |
IssueAdviceInfo issue_advice_; |
scoped_ptr<GaiaWebAuthFlow> gaia_web_auth_flow_; |
scoped_ptr<IdentitySigninFlow> signin_flow_; |
+ scoped_ptr<OAuth2TokenService::Request> device_token_request_; |
}; |
class IdentityRemoveCachedAuthTokenFunction : public SyncExtensionFunction { |