| 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_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 6 #define CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/android/jni_weak_ref.h" | 11 #include "base/android/jni_weak_ref.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 15 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 16 #include "google_apis/gaia/google_service_auth_error.h" | 16 #include "google_apis/gaia/google_service_auth_error.h" |
| 17 | 17 |
| 18 // A specialization of ProfileOAuth2TokenService that will be returned by | 18 // A specialization of ProfileOAuth2TokenService that will be returned by |
| 19 // ProfileOAuth2TokenServiceFactory for OS_ANDROID. This instance uses | 19 // ProfileOAuth2TokenServiceFactory for OS_ANDROID. This instance uses |
| 20 // native Android features to lookup OAuth2 tokens. | 20 // native Android features to lookup OAuth2 tokens. |
| 21 // | 21 // |
| 22 // See |ProfileOAuth2TokenService| for usage details. | 22 // See |ProfileOAuth2TokenService| for usage details. |
| 23 // | 23 // |
| 24 // Note: requests should be started from the UI thread. To start a | 24 // Note: requests should be started from the UI thread. To start a |
| 25 // request from other thread, please use ProfileOAuth2TokenServiceRequest. | 25 // request from other thread, please use OAuth2TokenServiceRequest. |
| 26 class AndroidProfileOAuth2TokenService : public ProfileOAuth2TokenService { | 26 class AndroidProfileOAuth2TokenService : public ProfileOAuth2TokenService { |
| 27 public: | 27 public: |
| 28 // Registers the AndroidProfileOAuth2TokenService's native methods through | 28 // Registers the AndroidProfileOAuth2TokenService's native methods through |
| 29 // JNI. | 29 // JNI. |
| 30 static bool Register(JNIEnv* env); | 30 static bool Register(JNIEnv* env); |
| 31 | 31 |
| 32 // Creates a new instance of the AndroidProfileOAuth2TokenService. | 32 // Creates a new instance of the AndroidProfileOAuth2TokenService. |
| 33 static AndroidProfileOAuth2TokenService* Create(); | 33 static AndroidProfileOAuth2TokenService* Create(); |
| 34 | 34 |
| 35 // Returns a reference to the Java instance of this service. | 35 // Returns a reference to the Java instance of this service. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 std::vector<std::string>& refreshed_ids, | 117 std::vector<std::string>& refreshed_ids, |
| 118 std::vector<std::string>& revoked_ids); | 118 std::vector<std::string>& revoked_ids); |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 121 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService); | 123 DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 126 #endif // CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| OLD | NEW |