OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 | 12 |
13 class GURL; | |
14 class PrefService; | 13 class PrefService; |
15 class Profile; | 14 class Profile; |
16 | 15 |
17 namespace base { | 16 namespace base { |
18 class CommandLine; | 17 class CommandLine; |
19 } | 18 } |
20 | 19 |
21 namespace chromeos { | 20 namespace chromeos { |
22 | 21 |
23 class Authenticator; | 22 class Authenticator; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // session after browser crash so no need to start new session. | 66 // session after browser crash so no need to start new session. |
68 virtual void PrepareProfile( | 67 virtual void PrepareProfile( |
69 const UserContext& user_context, | 68 const UserContext& user_context, |
70 bool has_auth_cookies, | 69 bool has_auth_cookies, |
71 bool has_active_session, | 70 bool has_active_session, |
72 Delegate* delegate) = 0; | 71 Delegate* delegate) = 0; |
73 | 72 |
74 // Invalidates |delegate|, which was passed to PrepareProfile method call. | 73 // Invalidates |delegate|, which was passed to PrepareProfile method call. |
75 virtual void DelegateDeleted(Delegate* delegate) = 0; | 74 virtual void DelegateDeleted(Delegate* delegate) = 0; |
76 | 75 |
77 // Invoked after the tmpfs is successfully mounted. | |
78 // Asks session manager to restart Chrome in Browse Without Sign In mode. | |
79 // |start_url| is url for launched browser to open. | |
80 virtual void CompleteOffTheRecordLogin(const GURL& start_url) = 0; | |
81 | |
82 // Creates and returns the authenticator to use. | 76 // Creates and returns the authenticator to use. |
83 // Before WebUI login (Up to R14) the caller owned the returned | 77 // Before WebUI login (Up to R14) the caller owned the returned |
84 // Authenticator instance and had to delete it when done. | 78 // Authenticator instance and had to delete it when done. |
85 // New instance was created on each new login attempt. | 79 // New instance was created on each new login attempt. |
86 // Starting with WebUI login (R15) single Authenticator instance is used for | 80 // Starting with WebUI login (R15) single Authenticator instance is used for |
87 // entire login process, even for multiple retries. Authenticator instance | 81 // entire login process, even for multiple retries. Authenticator instance |
88 // holds reference to login profile and is later used during fetching of | 82 // holds reference to login profile and is later used during fetching of |
89 // OAuth tokens. | 83 // OAuth tokens. |
90 // TODO(nkostylev): Cleanup after WebUI login migration is complete. | 84 // TODO(nkostylev): Cleanup after WebUI login migration is complete. |
91 virtual scoped_refptr<Authenticator> CreateAuthenticator( | 85 virtual scoped_refptr<Authenticator> CreateAuthenticator( |
92 AuthStatusConsumer* consumer) = 0; | 86 AuthStatusConsumer* consumer) = 0; |
93 | 87 |
94 // Initiates process restart if needed. | 88 // Initiates process restart if needed. |
95 // |early_restart| is true if this restart attempt happens before user profile | 89 // |early_restart| is true if this restart attempt happens before user profile |
96 // is fully initialized. | 90 // is fully initialized. |
97 // Might not return if restart is possible right now. | 91 // Might not return if restart is possible right now. |
98 // Returns true if restart was scheduled. | 92 // Returns true if restart was scheduled. |
99 // Returns false if no restart is needed, | 93 // Returns false if no restart is needed, |
100 virtual bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile, | 94 virtual bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile, |
101 bool early_restart) = 0; | 95 bool early_restart) = 0; |
102 }; | 96 }; |
103 | 97 |
104 } // namespace chromeos | 98 } // namespace chromeos |
105 | 99 |
106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ | 100 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
OLD | NEW |