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

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

Issue 12929014: Identity API: Pop-up a sign-in dialog if gaia credentials are bad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: launch sign-in through LoginUIService Created 7 years, 9 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_signin_flow.h
diff --git a/chrome/browser/extensions/api/identity/identity_signin_flow.h b/chrome/browser/extensions/api/identity/identity_signin_flow.h
new file mode 100644
index 0000000000000000000000000000000000000000..6d903447ebe9a36fd56d10bcd37e53db2e552173
--- /dev/null
+++ b/chrome/browser/extensions/api/identity/identity_signin_flow.h
@@ -0,0 +1,65 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_SIGNIN_FLOW_H_
+#define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_SIGNIN_FLOW_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/signin/signin_tracker.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+
+class GoogleServiceAuthError;
+class Profile;
+
+namespace extensions {
+
+class IdentitySigninFlow : public SigninTracker::Observer,
+ public content::NotificationObserver {
+ public:
+ class Delegate {
+ public:
+ Delegate() {}
+ virtual ~Delegate() {}
+ // Called when the flow has completed successfully.
+ virtual void SigninSuccess(const std::string& token) = 0;
+ // Called when the flow has failed.
+ virtual void SigninFailed() = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+ };
+
+ IdentitySigninFlow(Delegate* delegate,
+ Profile* profile);
+ virtual ~IdentitySigninFlow();
+
+ void Start();
+
+ // SigninTracker::Observer implementation.
Pete Williamson 2013/03/27 18:03:55 If we aren't using the signin tracker observer yet
Michael Courage 2013/03/27 18:40:11 Done.
+ virtual void GaiaCredentialsValid() OVERRIDE {}
+ virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE;
+ virtual void SigninSuccess() OVERRIDE {}
+
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ private:
+ void ReportSigninSuccess(const std::string& token);
+
+ Delegate* delegate_;
+ Profile* profile_;
+ // Used to listen to notifications from the TokenService.
+ content::NotificationRegistrar registrar_;
+ scoped_ptr<SigninTracker> signin_tracker_;
+
+ DISALLOW_COPY_AND_ASSIGN(IdentitySigninFlow);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_SIGNIN_FLOW_H_

Powered by Google App Engine
This is Rietveld 408576698