| 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_LOGIN_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_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 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // instance will be created. | 21 // instance will be created. |
| 22 static LoginUtils* Get(); | 22 static LoginUtils* Get(); |
| 23 | 23 |
| 24 // Set LoginUtils singleton object for test purpose only! | 24 // Set LoginUtils singleton object for test purpose only! |
| 25 static void Set(LoginUtils* ptr); | 25 static void Set(LoginUtils* ptr); |
| 26 | 26 |
| 27 // Thin wrapper around BrowserInit::LaunchBrowser(). Meant to be used in a | 27 // Thin wrapper around BrowserInit::LaunchBrowser(). Meant to be used in a |
| 28 // Task posted to the UI thread. | 28 // Task posted to the UI thread. |
| 29 static void DoBrowserLaunch(Profile* profile); | 29 static void DoBrowserLaunch(Profile* profile); |
| 30 | 30 |
| 31 // Extracts specified param from given ClientLogin response. |
| 32 // Returns the param value if found, empty string otherwise. |
| 33 // Ex. prefix: "Auth=", suffix: "\n" |
| 34 static std::string ExtractClientLoginParam(const std::string& credentials, |
| 35 const std::string& param_prefix, |
| 36 const std::string& param_suffix); |
| 37 |
| 31 virtual ~LoginUtils() {} | 38 virtual ~LoginUtils() {} |
| 32 | 39 |
| 33 // Returns true if we are still waiting for wifi connection. | 40 // Returns true if we are still waiting for wifi connection. |
| 34 virtual bool ShouldWaitForWifi() = 0; | 41 virtual bool ShouldWaitForWifi() = 0; |
| 35 | 42 |
| 36 // Invoked after the user has successfully logged in. This launches a browser | 43 // Invoked after the user has successfully logged in. This launches a browser |
| 37 // and does other bookkeeping after logging in. | 44 // and does other bookkeeping after logging in. |
| 38 virtual void CompleteLogin(const std::string& username, | 45 virtual void CompleteLogin(const std::string& username, |
| 39 const std::string& credentials) = 0; | 46 const std::string& credentials) = 0; |
| 40 | 47 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 53 // Returns if browser launch enabled now or not. | 60 // Returns if browser launch enabled now or not. |
| 54 virtual bool IsBrowserLaunchEnabled() const = 0; | 61 virtual bool IsBrowserLaunchEnabled() const = 0; |
| 55 | 62 |
| 56 // Returns auth token for 'cp' Contacts service. | 63 // Returns auth token for 'cp' Contacts service. |
| 57 virtual const std::string& GetAuthToken() const = 0; | 64 virtual const std::string& GetAuthToken() const = 0; |
| 58 }; | 65 }; |
| 59 | 66 |
| 60 } // namespace chromeos | 67 } // namespace chromeos |
| 61 | 68 |
| 62 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ | 69 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
| OLD | NEW |