| Index: chrome/browser/signin/oauth2_token_service_delegate_android.h
|
| diff --git a/chrome/browser/signin/oauth2_token_service_delegate_android.h b/chrome/browser/signin/oauth2_token_service_delegate_android.h
|
| index 8db8a5bfb5b161044c6d42628e9f561e0ea6eb72..b7cf7bb2307cbeef58a5be3242ddd4ff83527a44 100644
|
| --- a/chrome/browser/signin/oauth2_token_service_delegate_android.h
|
| +++ b/chrome/browser/signin/oauth2_token_service_delegate_android.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_SIGNIN_DELEGATE_ANDROID_OAUTH2_TOKEN_SERVICE_H_
|
| -#define CHROME_BROWSER_SIGNIN_DELEGATE_ANDROID_OAUTH2_TOKEN_SERVICE_H_
|
| +#ifndef CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_DELEGATE_ANDROID_H_
|
| +#define CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_DELEGATE_ANDROID_H_
|
|
|
| #include <jni.h>
|
| #include <string>
|
| @@ -12,6 +12,7 @@
|
| #include "base/callback.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/time/time.h"
|
| +#include "components/signin/core/browser/account_tracker_service.h"
|
| #include "components/signin/core/browser/profile_oauth2_token_service.h"
|
| #include "google_apis/gaia/google_service_auth_error.h"
|
| #include "google_apis/gaia/oauth2_token_service_delegate.h"
|
| @@ -43,7 +44,7 @@ class OAuth2TokenServiceDelegateAndroid : public OAuth2TokenServiceDelegate {
|
| // accounts which requires special permission.
|
| static void set_is_testing_profile() { is_testing_profile_ = true; }
|
|
|
| - void Initialize();
|
| + void Initialize(AccountTrackerService* account_tracker_service);
|
|
|
| // OAuth2TokenServiceDelegate overrides:
|
| bool RefreshTokenIsAvailable(const std::string& account_id) const override;
|
| @@ -51,8 +52,8 @@ class OAuth2TokenServiceDelegateAndroid : public OAuth2TokenServiceDelegate {
|
| const GoogleServiceAuthError& error) override;
|
| std::vector<std::string> GetAccounts() override;
|
|
|
| - // Lists account at the OS level.
|
| - std::vector<std::string> GetSystemAccounts();
|
| + // Lists account names at the OS level.
|
| + std::vector<std::string> GetSystemAccountNames();
|
|
|
| void ValidateAccounts(JNIEnv* env,
|
| jobject obj,
|
| @@ -85,6 +86,8 @@ class OAuth2TokenServiceDelegateAndroid : public OAuth2TokenServiceDelegate {
|
| // OA2TService aware accounts.
|
| void RevokeAllCredentials() override;
|
|
|
| + void LoadCredentials(const std::string& primary_account_id) override;
|
| +
|
| protected:
|
| friend class ProfileOAuth2TokenServiceFactory;
|
| OAuth2TokenServiceDelegateAndroid();
|
| @@ -110,6 +113,9 @@ class OAuth2TokenServiceDelegateAndroid : public OAuth2TokenServiceDelegate {
|
| void FireRefreshTokensLoaded() override;
|
|
|
| private:
|
| + std::string MapAccountIdToAccountName(const std::string& account_id) const;
|
| + std::string MapAccountNameToAccountId(const std::string& account_name) const;
|
| +
|
| // Return whether |signed_in_account| is valid and we have access
|
| // to all the tokens in |curr_account_ids|. If |force_notifications| is true,
|
| // TokenAvailable notifications will be sent anyway, even if the account was
|
| @@ -123,9 +129,13 @@ class OAuth2TokenServiceDelegateAndroid : public OAuth2TokenServiceDelegate {
|
|
|
| base::android::ScopedJavaGlobalRef<jobject> java_ref_;
|
|
|
| + AccountTrackerService* account_tracker_service_;
|
| + bool accounts_have_been_validated_;
|
| + bool should_fire_refresh_token_loaded_;
|
| + base::Lock lock_;
|
| static bool is_testing_profile_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(OAuth2TokenServiceDelegateAndroid);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_SIGNIN_DELEGATE_ANDROID_OAUTH2_TOKEN_SERVICE_H_
|
| +#endif // CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_DELEGATE_ANDROID_H_
|
|
|