Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_SIGNIN_FLOW_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_SIGNIN_FLOW_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "content/public/browser/notification_observer.h" | |
| 12 #include "content/public/browser/notification_registrar.h" | |
| 13 | |
| 14 class Profile; | |
| 15 | |
| 16 namespace extensions { | |
| 17 | |
| 18 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.
| |
| 19 public: | |
| 20 class Delegate { | |
| 21 public: | |
| 22 Delegate() {} | |
| 23 virtual ~Delegate() {} | |
| 24 // Called when the flow has completed successfully. | |
| 25 virtual void SigninSuccess(const std::string& token) = 0; | |
| 26 // Called when the flow has failed. | |
| 27 virtual void SigninFailed() = 0; | |
| 28 | |
| 29 DISALLOW_COPY_AND_ASSIGN(Delegate); | |
| 30 }; | |
| 31 | |
| 32 IdentitySigninFlow(Delegate* delegate, | |
| 33 Profile* profile); | |
| 34 virtual ~IdentitySigninFlow(); | |
| 35 | |
| 36 // Starts the flow. Should only be called once. | |
| 37 void Start(); | |
| 38 | |
| 39 // content::NotificationObserver implementation. | |
| 40 virtual void Observe(int type, | |
| 41 const content::NotificationSource& source, | |
| 42 const content::NotificationDetails& details) OVERRIDE; | |
| 43 | |
| 44 private: | |
| 45 Delegate* delegate_; | |
| 46 Profile* profile_; | |
| 47 // Used to listen to notifications from the TokenService. | |
| 48 content::NotificationRegistrar registrar_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(IdentitySigninFlow); | |
| 51 }; | |
| 52 | |
| 53 } // namespace extensions | |
| 54 | |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_SIGNIN_FLOW_H_ | |
| OLD | NEW |