OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_OAUTH_LOGIN_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH_LOGIN_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH_LOGIN_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH_LOGIN_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
oshima
2013/02/16 00:05:23
ditto
zel
2013/02/16 00:56:28
Done.
| |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "net/url_request/url_request_context_getter.h" | 11 #include "net/url_request/url_request_context_getter.h" |
12 | 12 |
13 class Profile; | 13 class Profile; |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 // This class is responsible for restoring authenticated web sessions out of | 17 // This class is responsible for restoring authenticated web sessions out of |
18 // OAuth tokens or vice versa. | 18 // OAuth tokens or vice versa. |
19 class OAuthLoginManager { | 19 class OAuthLoginManager { |
20 public: | 20 public: |
21 enum SessionRestoreState { | 21 enum SessionRestoreState { |
22 // Session restore is not started. | 22 // Session restore is not started. |
23 SESSION_RESTORE_NOT_STARTED, | 23 SESSION_RESTORE_NOT_STARTED, |
24 // Session restore is in progress. We are currently issuing calls to verify | 24 // Session restore is in progress. We are currently issuing calls to verify |
25 // stored OAuth tokens and populate cookie jar with GAIA credentials. | 25 // stored OAuth tokens and populate cookie jar with GAIA credentials. |
26 SESSION_RESTORE_IN_PROGRESS, | 26 SESSION_RESTORE_IN_PROGRESS, |
27 // Session restore is completed. | 27 // Session restore is completed. |
28 SESSION_RESTORE_DONE, | 28 SESSION_RESTORE_DONE, |
29 }; | 29 }; |
30 | 30 |
31 class Delegate { | 31 class Delegate { |
32 public: | 32 public: |
33 virtual ~Delegate() {} | 33 virtual ~Delegate() {} |
34 | 34 |
35 // Raised when merge session is completed. | |
36 virtual void OnCompletedMergeSession() = 0; | |
37 | |
35 // Raised when cookie jar authentication is successfully completed. | 38 // Raised when cookie jar authentication is successfully completed. |
36 virtual void OnCompletedAuthentication(Profile* user_profile) = 0; | 39 virtual void OnCompletedAuthentication(Profile* user_profile) = 0; |
37 | 40 |
38 // Raised when stored OAuth(1|2) tokens are found and authentication | 41 // Raised when stored OAuth(1|2) tokens are found and authentication |
39 // profile is no longer needed. | 42 // profile is no longer needed. |
40 virtual void OnFoundStoredTokens() = 0; | 43 virtual void OnFoundStoredTokens() = 0; |
41 | 44 |
42 // Raised when policy tokens are retrieved. | 45 // Raised when policy tokens are retrieved. |
43 virtual void OnRestoredPolicyTokens() {} | 46 virtual void OnRestoredPolicyTokens() {} |
44 }; | 47 }; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 scoped_refptr<net::URLRequestContextGetter> auth_request_context_; | 82 scoped_refptr<net::URLRequestContextGetter> auth_request_context_; |
80 bool restore_from_auth_cookies_; | 83 bool restore_from_auth_cookies_; |
81 SessionRestoreState state_; | 84 SessionRestoreState state_; |
82 | 85 |
83 DISALLOW_COPY_AND_ASSIGN(OAuthLoginManager); | 86 DISALLOW_COPY_AND_ASSIGN(OAuthLoginManager); |
84 }; | 87 }; |
85 | 88 |
86 } // namespace chromeos | 89 } // namespace chromeos |
87 | 90 |
88 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH_LOGIN_MANAGER_H_ | 91 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH_LOGIN_MANAGER_H_ |
OLD | NEW |