| 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 22 matching lines...) Expand all Loading... |
| 33 virtual ~OAuth2LoginManager(); | 33 virtual ~OAuth2LoginManager(); |
| 34 | 34 |
| 35 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 35 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
| 36 | 36 |
| 37 // OAuthLoginManager overrides. | 37 // OAuthLoginManager overrides. |
| 38 virtual void RestorePolicyTokens( | 38 virtual void RestorePolicyTokens( |
| 39 net::URLRequestContextGetter* auth_request_context) OVERRIDE; | 39 net::URLRequestContextGetter* auth_request_context) OVERRIDE; |
| 40 virtual void RestoreSession( | 40 virtual void RestoreSession( |
| 41 Profile* user_profile, | 41 Profile* user_profile, |
| 42 net::URLRequestContextGetter* auth_request_context, | 42 net::URLRequestContextGetter* auth_request_context, |
| 43 bool restore_from_auth_cookies) OVERRIDE; | 43 SessionRestoreStrategy restore_strategy, |
| 44 const std::string& oauth2_refresh_token, |
| 45 const std::string& auth_code) OVERRIDE; |
| 44 virtual void ContinueSessionRestore() OVERRIDE; | 46 virtual void ContinueSessionRestore() OVERRIDE; |
| 45 virtual void Stop() OVERRIDE; | 47 virtual void Stop() OVERRIDE; |
| 46 | 48 |
| 47 private: | 49 private: |
| 48 // Session restore outcomes (for UMA). | 50 // Session restore outcomes (for UMA). |
| 49 enum { | 51 enum { |
| 50 SESSION_RESTORE_UNDEFINED = 0, | 52 SESSION_RESTORE_UNDEFINED = 0, |
| 51 SESSION_RESTORE_SUCCESS = 1, | 53 SESSION_RESTORE_SUCCESS = 1, |
| 52 SESSION_RESTORE_TOKEN_FETCH_FAILED = 2, | 54 SESSION_RESTORE_TOKEN_FETCH_FAILED = 2, |
| 53 SESSION_RESTORE_NO_REFRESH_TOKEN_FAILED = 3, | 55 SESSION_RESTORE_NO_REFRESH_TOKEN_FAILED = 3, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 113 |
| 112 // Keeps the track if we have already reported OAuth2 token being loaded | 114 // Keeps the track if we have already reported OAuth2 token being loaded |
| 113 // by TokenService. | 115 // by TokenService. |
| 114 bool loading_reported_; | 116 bool loading_reported_; |
| 115 content::NotificationRegistrar registrar_; | 117 content::NotificationRegistrar registrar_; |
| 116 scoped_ptr<OAuth2TokenFetcher> oauth2_token_fetcher_; | 118 scoped_ptr<OAuth2TokenFetcher> oauth2_token_fetcher_; |
| 117 scoped_ptr<OAuth2LoginVerifier> login_verifier_; | 119 scoped_ptr<OAuth2LoginVerifier> login_verifier_; |
| 118 scoped_ptr<OAuth2PolicyFetcher> oauth2_policy_fetcher_; | 120 scoped_ptr<OAuth2PolicyFetcher> oauth2_policy_fetcher_; |
| 119 // OAuth2 refresh token. | 121 // OAuth2 refresh token. |
| 120 std::string refresh_token_; | 122 std::string refresh_token_; |
| 123 // Authorization code for fetching OAuth2 tokens. |
| 124 std::string auth_code_; |
| 121 | 125 |
| 122 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManager); | 126 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManager); |
| 123 }; | 127 }; |
| 124 | 128 |
| 125 } // namespace chromeos | 129 } // namespace chromeos |
| 126 | 130 |
| 127 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_H_ | 131 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_H_ |
| OLD | NEW |