OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_SIGNIN_SIGNIN_OAUTH_HELPER_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_OAUTH_HELPER_H_ |
6 #define CHROME_BROWSER_SIGNIN_SIGNIN_OAUTH_HELPER_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_OAUTH_HELPER_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" |
11 #include "google_apis/gaia/gaia_auth_consumer.h" | 11 #include "google_apis/gaia/gaia_auth_consumer.h" |
12 #include "google_apis/gaia/gaia_auth_fetcher.h" | 12 #include "google_apis/gaia/gaia_auth_fetcher.h" |
13 | 13 |
14 // Retrieves the OAuth2 information from an already signed in cookie jar. | 14 // Retrieves the OAuth2 information from an already signed in cookie jar. |
15 // The information retrieved is: username, refresh token. | 15 // The information retrieved is: username, refresh token. |
16 class SigninOAuthHelper : public GaiaAuthConsumer { | 16 class SigninOAuthHelper : public GaiaAuthConsumer { |
(...skipping 18 matching lines...) Expand all Loading... |
35 }; | 35 }; |
36 | 36 |
37 explicit SigninOAuthHelper(net::URLRequestContextGetter* getter, | 37 explicit SigninOAuthHelper(net::URLRequestContextGetter* getter, |
38 const std::string& session_index, | 38 const std::string& session_index, |
39 Consumer* consumer); | 39 Consumer* consumer); |
40 virtual ~SigninOAuthHelper(); | 40 virtual ~SigninOAuthHelper(); |
41 | 41 |
42 private: | 42 private: |
43 // Overridden from GaiaAuthConsumer. | 43 // Overridden from GaiaAuthConsumer. |
44 virtual void OnClientOAuthSuccess(const ClientOAuthResult& result) OVERRIDE; | 44 virtual void OnClientOAuthSuccess(const ClientOAuthResult& result) OVERRIDE; |
45 virtual void OnClientOAuthFailure( | 45 virtual void OnClientOAuthFailure(const GoogleServiceAuthError& error) |
46 const GoogleServiceAuthError& error) OVERRIDE; | 46 OVERRIDE; |
47 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; | 47 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; |
48 virtual void OnClientLoginFailure( | 48 virtual void OnClientLoginFailure(const GoogleServiceAuthError& error) |
49 const GoogleServiceAuthError& error) OVERRIDE; | 49 OVERRIDE; |
50 virtual void OnGetUserInfoSuccess(const UserInfoMap& data) OVERRIDE; | 50 virtual void OnGetUserInfoSuccess(const UserInfoMap& data) OVERRIDE; |
51 virtual void OnGetUserInfoFailure( | 51 virtual void OnGetUserInfoFailure(const GoogleServiceAuthError& error) |
52 const GoogleServiceAuthError& error) OVERRIDE; | 52 OVERRIDE; |
53 | 53 |
54 GaiaAuthFetcher gaia_auth_fetcher_; | 54 GaiaAuthFetcher gaia_auth_fetcher_; |
55 std::string refresh_token_; | 55 std::string refresh_token_; |
56 Consumer* consumer_; | 56 Consumer* consumer_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(SigninOAuthHelper); | 58 DISALLOW_COPY_AND_ASSIGN(SigninOAuthHelper); |
59 }; | 59 }; |
60 | 60 |
61 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_OAUTH_HELPER_H_ | 61 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_OAUTH_HELPER_H_ |
OLD | NEW |