| 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 #include "chrome/browser/signin/android_profile_oauth2_token_service.h" | 5 #include "chrome/browser/signin/android_profile_oauth2_token_service.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 class AndroidAccessTokenFetcher : public OAuth2AccessTokenFetcher { | 37 class AndroidAccessTokenFetcher : public OAuth2AccessTokenFetcher { |
| 38 public: | 38 public: |
| 39 AndroidAccessTokenFetcher(OAuth2AccessTokenConsumer* consumer, | 39 AndroidAccessTokenFetcher(OAuth2AccessTokenConsumer* consumer, |
| 40 const std::string& account_id); | 40 const std::string& account_id); |
| 41 virtual ~AndroidAccessTokenFetcher(); | 41 virtual ~AndroidAccessTokenFetcher(); |
| 42 | 42 |
| 43 // Overrides from OAuth2AccessTokenFetcher: | 43 // Overrides from OAuth2AccessTokenFetcher: |
| 44 virtual void Start(const std::string& client_id, | 44 virtual void Start(const std::string& client_id, |
| 45 const std::string& client_secret, | 45 const std::string& client_secret, |
| 46 const std::vector<std::string>& scopes) OVERRIDE; | 46 const std::vector<std::string>& scopes) override; |
| 47 virtual void CancelRequest() OVERRIDE; | 47 virtual void CancelRequest() override; |
| 48 | 48 |
| 49 // Handles an access token response. | 49 // Handles an access token response. |
| 50 void OnAccessTokenResponse(const GoogleServiceAuthError& error, | 50 void OnAccessTokenResponse(const GoogleServiceAuthError& error, |
| 51 const std::string& access_token, | 51 const std::string& access_token, |
| 52 const base::Time& expiration_time); | 52 const base::Time& expiration_time); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 std::string CombineScopes(const std::vector<std::string>& scopes); | 55 std::string CombineScopes(const std::vector<std::string>& scopes); |
| 56 | 56 |
| 57 base::WeakPtrFactory<AndroidAccessTokenFetcher> weak_factory_; | 57 base::WeakPtrFactory<AndroidAccessTokenFetcher> weak_factory_; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 GoogleServiceAuthError err(result ? | 453 GoogleServiceAuthError err(result ? |
| 454 GoogleServiceAuthError::NONE : | 454 GoogleServiceAuthError::NONE : |
| 455 GoogleServiceAuthError::CONNECTION_FAILED); | 455 GoogleServiceAuthError::CONNECTION_FAILED); |
| 456 heap_callback->Run(err, token, base::Time()); | 456 heap_callback->Run(err, token, base::Time()); |
| 457 } | 457 } |
| 458 | 458 |
| 459 // static | 459 // static |
| 460 bool AndroidProfileOAuth2TokenService::Register(JNIEnv* env) { | 460 bool AndroidProfileOAuth2TokenService::Register(JNIEnv* env) { |
| 461 return RegisterNativesImpl(env); | 461 return RegisterNativesImpl(env); |
| 462 } | 462 } |
| OLD | NEW |