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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 static void Set(LoginUtils* ptr); | 29 static void Set(LoginUtils* ptr); |
30 | 30 |
31 // Thin wrapper around BrowserInit::LaunchBrowser(). Meant to be used in a | 31 // Thin wrapper around BrowserInit::LaunchBrowser(). Meant to be used in a |
32 // Task posted to the UI thread. | 32 // Task posted to the UI thread. |
33 static void DoBrowserLaunch(Profile* profile); | 33 static void DoBrowserLaunch(Profile* profile); |
34 | 34 |
35 virtual ~LoginUtils() {} | 35 virtual ~LoginUtils() {} |
36 | 36 |
37 // Invoked after the user has successfully logged in. This launches a browser | 37 // Invoked after the user has successfully logged in. This launches a browser |
38 // and does other bookkeeping after logging in. | 38 // and does other bookkeeping after logging in. |
| 39 // If |pending_requests| is true, there's a pending online auth request. |
39 virtual void CompleteLogin( | 40 virtual void CompleteLogin( |
40 const std::string& username, | 41 const std::string& username, |
41 const std::string& password, | 42 const std::string& password, |
42 const GaiaAuthConsumer::ClientLoginResult& credentials) = 0; | 43 const GaiaAuthConsumer::ClientLoginResult& credentials, |
| 44 bool pending_requests) = 0; |
43 | 45 |
44 // Invoked after the tmpfs is successfully mounted. | 46 // Invoked after the tmpfs is successfully mounted. |
45 // Asks session manager to restart Chrome in Browse Without Sign In mode. | 47 // Asks session manager to restart Chrome in Browse Without Sign In mode. |
46 // |start_url| is url for launched browser to open. | 48 // |start_url| is url for launched browser to open. |
47 virtual void CompleteOffTheRecordLogin(const GURL& start_url) = 0; | 49 virtual void CompleteOffTheRecordLogin(const GURL& start_url) = 0; |
48 | 50 |
49 // Invoked when the user is logging in for the first time, or is logging in as | 51 // Invoked when the user is logging in for the first time, or is logging in as |
50 // a guest user. | 52 // a guest user. |
51 virtual void SetFirstLoginPrefs(PrefService* prefs) = 0; | 53 virtual void SetFirstLoginPrefs(PrefService* prefs) = 0; |
52 | 54 |
53 // Creates and returns the authenticator to use. The caller owns the returned | 55 // Creates and returns the authenticator to use. The caller owns the returned |
54 // Authenticator and must delete it when done. | 56 // Authenticator and must delete it when done. |
55 virtual Authenticator* CreateAuthenticator(LoginStatusConsumer* consumer) = 0; | 57 virtual Authenticator* CreateAuthenticator(LoginStatusConsumer* consumer) = 0; |
56 | 58 |
57 // Used to postpone browser launch via DoBrowserLaunch() if some post | 59 // Used to postpone browser launch via DoBrowserLaunch() if some post |
58 // login screen is to be shown. | 60 // login screen is to be shown. |
59 virtual void EnableBrowserLaunch(bool enable) = 0; | 61 virtual void EnableBrowserLaunch(bool enable) = 0; |
60 | 62 |
61 // Returns if browser launch enabled now or not. | 63 // Returns if browser launch enabled now or not. |
62 virtual bool IsBrowserLaunchEnabled() const = 0; | 64 virtual bool IsBrowserLaunchEnabled() const = 0; |
63 | 65 |
64 // Prewarms the authentication network connection. | 66 // Prewarms the authentication network connection. |
65 virtual void PrewarmAuthentication() = 0; | 67 virtual void PrewarmAuthentication() = 0; |
66 | 68 |
| 69 // Given the credentials try to exchange them for |
| 70 // full-fledged Google authentication cookies. |
| 71 virtual void FetchCookies( |
| 72 Profile* profile, |
| 73 const GaiaAuthConsumer::ClientLoginResult& credentials) = 0; |
| 74 |
| 75 // Supply credentials for sync and others to use. |
| 76 virtual void FetchTokens( |
| 77 Profile* profile, |
| 78 const GaiaAuthConsumer::ClientLoginResult& credentials) = 0; |
| 79 |
67 }; | 80 }; |
68 | 81 |
69 } // namespace chromeos | 82 } // namespace chromeos |
70 | 83 |
71 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ | 84 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
OLD | NEW |