| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SUPERVISED_USER_PERMISSION_REQUEST_CREATOR_APIARY_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_PERMISSION_REQUEST_CREATOR_APIARY_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_PERMISSION_REQUEST_CREATOR_APIARY_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_PERMISSION_REQUEST_CREATOR_APIARY_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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // OAuth2TokenService::Consumer implementation: | 46 // OAuth2TokenService::Consumer implementation: |
| 47 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | 47 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
| 48 const std::string& access_token, | 48 const std::string& access_token, |
| 49 const base::Time& expiration_time) OVERRIDE; | 49 const base::Time& expiration_time) OVERRIDE; |
| 50 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 50 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
| 51 const GoogleServiceAuthError& error) OVERRIDE; | 51 const GoogleServiceAuthError& error) OVERRIDE; |
| 52 | 52 |
| 53 // net::URLFetcherDelegate implementation. | 53 // net::URLFetcherDelegate implementation. |
| 54 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 54 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| 55 | 55 |
| 56 std::string GetApiScopeToUse() const; |
| 57 |
| 56 // Requests an access token, which is the first thing we need. This is where | 58 // Requests an access token, which is the first thing we need. This is where |
| 57 // we restart when the returned access token has expired. | 59 // we restart when the returned access token has expired. |
| 58 void StartFetching(); | 60 void StartFetching(); |
| 59 | 61 |
| 60 void DispatchNetworkError(int error_code); | 62 void DispatchNetworkError(int error_code); |
| 61 void DispatchGoogleServiceAuthError(const GoogleServiceAuthError& error); | 63 void DispatchGoogleServiceAuthError(const GoogleServiceAuthError& error); |
| 62 | 64 |
| 63 OAuth2TokenService* oauth2_token_service_; | 65 OAuth2TokenService* oauth2_token_service_; |
| 64 scoped_ptr<SupervisedUserSigninManagerWrapper> signin_wrapper_; | 66 scoped_ptr<SupervisedUserSigninManagerWrapper> signin_wrapper_; |
| 65 base::Closure callback_; | 67 base::Closure callback_; |
| 66 net::URLRequestContextGetter* context_; | 68 net::URLRequestContextGetter* context_; |
| 67 GURL url_requested_; | 69 GURL url_requested_; |
| 68 scoped_ptr<OAuth2TokenService::Request> access_token_request_; | 70 scoped_ptr<OAuth2TokenService::Request> access_token_request_; |
| 69 std::string access_token_; | 71 std::string access_token_; |
| 70 bool access_token_expired_; | 72 bool access_token_expired_; |
| 71 scoped_ptr<net::URLFetcher> url_fetcher_; | 73 scoped_ptr<net::URLFetcher> url_fetcher_; |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 #endif // CHROME_BROWSER_SUPERVISED_USER_PERMISSION_REQUEST_CREATOR_APIARY_H_ | 76 #endif // CHROME_BROWSER_SUPERVISED_USER_PERMISSION_REQUEST_CREATOR_APIARY_H_ |
| OLD | NEW |