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

Unified Diff: chrome/browser/extensions/api/identity/identity_api.h

Issue 15148007: Identity API: web-based scope approval dialogs for getAuthToken (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better protocol description Created 7 years, 7 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/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 9fb6ddcb2a5db0fbe6fae30138f0957380d72610..6a9876d1d2fd710f8f789803e66b8322e20cee3e 100644
--- a/chrome/browser/extensions/api/identity/identity_api.h
+++ b/chrome/browser/extensions/api/identity/identity_api.h
@@ -11,12 +11,12 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h"
#include "chrome/browser/extensions/api/identity/identity_mint_queue.h"
#include "chrome/browser/extensions/api/identity/identity_signin_flow.h"
#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/extensions/extension_install_prompt.h"
#include "chrome/browser/signin/signin_global_error.h"
#include "google_apis/gaia/oauth2_mint_token_flow.h"
@@ -58,7 +58,7 @@ extern const char kOffTheRecord[];
// new login token, there is a sign-in flow. If that flow completes
// successfully, getAuthToken proceeds to the non-interactive flow.
class IdentityGetAuthTokenFunction : public AsyncExtensionFunction,
- public ExtensionInstallPrompt::Delegate,
+ public GaiaWebAuthFlow::Delegate,
public IdentityMintRequestQueue::Request,
public OAuth2MintTokenFlow::Delegate,
public IdentitySigninFlow::Delegate {
@@ -102,9 +102,12 @@ class IdentityGetAuthTokenFunction : public AsyncExtensionFunction,
virtual void SigninSuccess(const std::string& token) OVERRIDE;
virtual void SigninFailed() OVERRIDE;
- // ExtensionInstallPrompt::Delegate implementation:
- virtual void InstallUIProceed() OVERRIDE;
- virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
+ // GaiaWebAuthFlow::Delegate implementation:
+ virtual void OnGaiaFlowFailure(GaiaWebAuthFlow::Failure failure,
+ GoogleServiceAuthError service_error) OVERRIDE;
+ virtual void OnGaiaFlowCompleted(const std::string& token,
+ const std::string& expiration,
+ const std::string& error) OVERRIDE;
// Starts a mint token request to GAIA.
void StartGaiaRequest(OAuth2MintTokenFlow::Mode mode);
@@ -119,6 +122,9 @@ class IdentityGetAuthTokenFunction : public AsyncExtensionFunction,
// Checks if there is a master login token to mint tokens for the extension.
virtual bool HasLoginToken() const;
+ // Maps OAuth2 protocol errors to an error message.
+ std::string MapOAuth2ErrorToDescription(const std::string& error);
+
bool should_prompt_for_scopes_;
IdentityMintRequestQueue::MintType mint_token_flow_type_;
scoped_ptr<OAuth2MintTokenFlow> mint_token_flow_;
@@ -128,7 +134,7 @@ class IdentityGetAuthTokenFunction : public AsyncExtensionFunction,
// When launched in interactive mode, and if there is no existing grant,
// a permissions prompt will be popped up to the user.
IssueAdviceInfo issue_advice_;
- scoped_ptr<ExtensionInstallPrompt> install_ui_;
+ scoped_ptr<GaiaWebAuthFlow> web_auth_flow_;
Roger Tawa OOO till Jul 10th 2013/05/16 16:06:15 Maybe call this |gaia_web_auth_flow_| instead to d
Michael Courage 2013/05/16 20:39:02 Done.
scoped_ptr<IdentitySigninFlow> signin_flow_;
};
@@ -163,6 +169,7 @@ class IdentityLaunchWebAuthFlowFunction : public AsyncExtensionFunction,
// WebAuthFlow::Delegate implementation.
virtual void OnAuthFlowFailure(WebAuthFlow::Failure failure) OVERRIDE;
virtual void OnAuthFlowURLChange(const GURL& redirect_url) OVERRIDE;
+ virtual void OnAuthFlowTitleChange(const std::string& title) OVERRIDE {}
// Helper to initialize final URL prefix.
void InitFinalRedirectURLPrefix(const std::string& extension_id);

Powered by Google App Engine
This is Rietveld 408576698