Chromium Code Reviews| Index: chrome/browser/sync/profile_sync_service_android.h |
| diff --git a/chrome/browser/sync/profile_sync_service_android.h b/chrome/browser/sync/profile_sync_service_android.h |
| index 1886b8127c06936d417344dbab606087e4860fe5..b25b618b7266d5ffb67b05b6b086560d6cf17036 100644 |
| --- a/chrome/browser/sync/profile_sync_service_android.h |
| +++ b/chrome/browser/sync/profile_sync_service_android.h |
| @@ -9,8 +9,11 @@ |
| #include <map> |
| #include "base/android/jni_helper.h" |
| +#include "base/callback.h" |
| #include "base/compiler_specific.h" |
| +#include "chrome/browser/signin/oauth2_token_service.h" |
| #include "chrome/browser/sync/profile_sync_service_observer.h" |
| +#include "google_apis/gaia/google_service_auth_error.h" |
| #include "sync/internal_api/public/base/model_type.h" |
| class Profile; |
| @@ -23,6 +26,10 @@ class ProfileSyncService; |
| // This class should only be accessed from the UI thread. |
| class ProfileSyncServiceAndroid : public ProfileSyncServiceObserver { |
| public: |
| + typedef base::Callback<void( |
| + const GoogleServiceAuthError,const std::string,const base::Time)> |
|
Nicolas Zea
2013/03/25 18:13:18
Comment about what these params are.
Roger Tawa OOO till Jul 10th
2013/03/25 19:14:35
Should these be const refs?
|
| + FetchOAuth2TokenCallback; |
| + |
| ProfileSyncServiceAndroid(JNIEnv* env, jobject obj); |
| // This method should be called once right after contructing the object. |
| @@ -187,9 +194,26 @@ class ProfileSyncServiceAndroid : public ProfileSyncServiceObserver { |
| // (GoogleServiceAuthError.State). |
| jint GetAuthError(JNIEnv* env, jobject obj); |
| + // Called by native when an OAuth2 token is required. The |callback| |
| + // param is a pointer to the callback. |invalid_auth_token| may be null, |
|
Nicolas Zea
2013/03/25 18:13:18
nit: not a pointer. Maybe just say that |callback|
Patrick Dubroy
2013/03/25 18:52:55
Done.
|
| + // if no old auth tokens need to be invalidated. |
| + void FetchOAuth2Token(const std::string& scope, |
| + const std::string& invalid_auth_token, |
| + const FetchOAuth2TokenCallback& callback); |
| + |
| + // Called from Java when fetching of an OAuth2 token is finished. The |
| + // |authToken| param is only valid when |result| is true. |
| + void OAuth2TokenFetched(JNIEnv* env, |
| + jobject obj, |
| + int callback, |
| + jstring auth_token, |
| + jboolean result); |
| + |
| // ProfileSyncServiceObserver: |
| virtual void OnStateChanged() OVERRIDE; |
| + static ProfileSyncServiceAndroid* GetProfileSyncServiceAndroid(); |
| + |
| // Registers the ProfileSyncServiceAndroid's native methods through JNI. |
| static bool Register(JNIEnv* env); |