Chromium Code Reviews| 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_ |