| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UTILS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 class Authenticator; | 11 class Authenticator; |
| 12 class LoginStatusConsumer; | 12 class LoginStatusConsumer; |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class Widget; | 15 class Widget; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 namespace login_utils { | 20 class LoginUtils { |
| 21 public: |
| 22 // Get LoginUtils singleton object. If it was not set before, new default |
| 23 // instance will be created. |
| 24 static LoginUtils* Get(); |
| 21 | 25 |
| 22 // Invoked after the user has successfully logged in. This launches a browser | 26 // Set LoginUtils singleton object for test purpose only! |
| 23 // and does other bookkeeping after logging in. | 27 static void Set(LoginUtils* ptr); |
| 24 void CompleteLogin(const std::string& username, | |
| 25 std::vector<std::string> cookies); | |
| 26 | 28 |
| 27 // Creates and returns the authenticator to use. The caller owns the returned | 29 virtual ~LoginUtils() {} |
| 28 // Authenticator and must delete it when done. | |
| 29 Authenticator* CreateAuthenticator(LoginStatusConsumer* consumer); | |
| 30 | 30 |
| 31 } // namespace login_utils | 31 // Invoked after the user has successfully logged in. This launches a browser |
| 32 // and does other bookkeeping after logging in. |
| 33 virtual void CompleteLogin(const std::string& username, |
| 34 std::vector<std::string> cookies) = 0; |
| 35 |
| 36 // Creates and returns the authenticator to use. The caller owns the returned |
| 37 // Authenticator and must delete it when done. |
| 38 virtual Authenticator* CreateAuthenticator(LoginStatusConsumer* consumer) = 0; |
| 39 }; |
| 32 | 40 |
| 33 } // namespace chromeos | 41 } // namespace chromeos |
| 34 | 42 |
| 35 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UTILS_H_ | 43 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
| OLD | NEW |