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_OAUTH2_LOGIN_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const GaiaAuthConsumer::ClientOAuthResult& oauth2_tokens) OVERRIDE; | 69 const GaiaAuthConsumer::ClientOAuthResult& oauth2_tokens) OVERRIDE; |
70 virtual void OnOAuth2TokensFetchFailed() OVERRIDE; | 70 virtual void OnOAuth2TokensFetchFailed() OVERRIDE; |
71 | 71 |
72 // Retrieves TokenService for |user_profile_| and sets up notification | 72 // Retrieves TokenService for |user_profile_| and sets up notification |
73 // observer events. | 73 // observer events. |
74 TokenService* SetupTokenService(); | 74 TokenService* SetupTokenService(); |
75 | 75 |
76 // Removes legacy tokens form OAuth1 flow. | 76 // Removes legacy tokens form OAuth1 flow. |
77 void RemoveLegacyTokens(); | 77 void RemoveLegacyTokens(); |
78 | 78 |
| 79 // Records OAuth2 tokens fetched through either policy fetcher or cookies-to- |
| 80 // token exchange into TokenService. |
| 81 void StoreOAuth2Tokens( |
| 82 const GaiaAuthConsumer::ClientOAuthResult& oauth2_tokens); |
| 83 |
79 // Loads previously stored OAuth2 tokens and kicks off its validation. | 84 // Loads previously stored OAuth2 tokens and kicks off its validation. |
80 void LoadAndVerifyOAuth2Tokens(); | 85 void LoadAndVerifyOAuth2Tokens(); |
81 | 86 |
82 // Attempts to fetch OAuth2 tokens by using pre-authenticated cookie jar from | 87 // Attempts to fetch OAuth2 tokens by using pre-authenticated cookie jar from |
83 // provided |auth_profile|. | 88 // provided |auth_profile|. |
84 void FetchOAuth2Tokens(); | 89 void FetchOAuth2Tokens(); |
85 | 90 |
86 // Reports when all tokens are loaded. | 91 // Reports when all tokens are loaded. |
87 void ReportOAuth2TokensLoaded(); | 92 void ReportOAuth2TokensLoaded(); |
88 | 93 |
(...skipping 21 matching lines...) Expand all Loading... |
110 scoped_ptr<OAuth2PolicyFetcher> oauth2_policy_fetcher_; | 115 scoped_ptr<OAuth2PolicyFetcher> oauth2_policy_fetcher_; |
111 // OAuth2 refresh token. | 116 // OAuth2 refresh token. |
112 std::string refresh_token_; | 117 std::string refresh_token_; |
113 | 118 |
114 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManager); | 119 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManager); |
115 }; | 120 }; |
116 | 121 |
117 } // namespace chromeos | 122 } // namespace chromeos |
118 | 123 |
119 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_H_ | 124 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_H_ |
OLD | NEW |