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

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: address code review comments 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..720a63e1f0fc8f558aeaad749547b9818b6b3472
--- /dev/null
+++ b/chrome/browser/extensions/api/identity/identity_signin_flow.h
@@ -0,0 +1,55 @@
+// 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 "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+
+class Profile;
+
+namespace extensions {
+
+class IdentitySigninFlow : public content::NotificationObserver {
Roger Tawa OOO till Jul 10th 2013/04/02 14:41:07 Please add a comment describing what this class do
Michael Courage 2013/04/02 17:17:49 Done.
+ 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();
+
+ // Starts the flow. Should only be called once.
+ void Start();
+
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ private:
+ Delegate* delegate_;
+ Profile* profile_;
+ // Used to listen to notifications from the TokenService.
+ content::NotificationRegistrar registrar_;
+
+ 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