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

Unified Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.h

Issue 196783002: Export a private webstore API to call into the new inline sign-in flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 8 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/extensions/api/webstore_private/webstore_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/webstore_private/webstore_private_api.h
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
index b9b748cc4efe3e2184f5db15bd7136b4f2c27594..41306e6f07f1d52ded688f368d9249d547e8be79 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h
@@ -12,6 +12,7 @@
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/webstore_install_helper.h"
#include "chrome/browser/extensions/webstore_installer.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/extensions/api/webstore_private.h"
#include "components/signin/core/browser/signin_tracker.h"
#include "content/public/browser/gpu_data_manager_observer.h"
@@ -21,6 +22,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
class ProfileSyncService;
+class SigninManagerBase;
namespace content {
class GpuDataManager;
@@ -304,6 +306,39 @@ class WebstorePrivateIsInIncognitoModeFunction
virtual bool RunImpl() OVERRIDE;
};
+class WebstorePrivateSignInFunction : public ChromeAsyncExtensionFunction,
+ public SigninManagerFactory::Observer,
+ public SigninTracker::Observer {
+ public:
+ DECLARE_EXTENSION_FUNCTION("webstorePrivate.signIn",
+ WEBSTOREPRIVATE_SIGNINFUNCTION)
+
+ WebstorePrivateSignInFunction();
+
+ protected:
+ virtual ~WebstorePrivateSignInFunction();
+
+ // ExtensionFunction:
+ virtual bool RunImpl() OVERRIDE;
+
+ // SigninManagerFactory::Observer:
+ virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE;
+
+ // SigninTracker::Observer:
+ virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE;
+ virtual void SigninSuccess() OVERRIDE;
+ virtual void MergeSessionComplete(const GoogleServiceAuthError& error)
+ OVERRIDE;
+
+ private:
+ // The sign-in manager for the invoking tab's Chrome Profile. Weak reference.
+ SigninManagerBase* signin_manager_;
+
+ // Tracks changes to sign-in state. Used to notify the page when an existing
+ // in-progress sign-in completes, either with success or failure.
+ scoped_ptr<SigninTracker> signin_tracker_;
+};
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/api/webstore_private/webstore_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698