Chromium Code Reviews| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 const std::string& account_id) OVERRIDE; | 43 const std::string& account_id) OVERRIDE; |
| 44 | 44 |
| 45 // Lists account IDs of all accounts with a refresh token. | 45 // Lists account IDs of all accounts with a refresh token. |
| 46 virtual std::vector<std::string> GetAccounts() OVERRIDE; | 46 virtual std::vector<std::string> GetAccounts() OVERRIDE; |
| 47 | 47 |
| 48 void ValidateAccounts(JNIEnv* env, | 48 void ValidateAccounts(JNIEnv* env, |
| 49 jobject obj, | 49 jobject obj, |
| 50 jobjectArray accounts, | 50 jobjectArray accounts, |
| 51 jstring current_account); | 51 jstring current_account); |
| 52 | 52 |
| 53 // Called to notify observers when a refresh token is available. | |
| 54 virtual void FireRefreshTokenAvailable( | |
| 55 const std::string& account_id) OVERRIDE; | |
|
Roger Tawa OOO till Jul 10th
2013/11/21 16:02:32
Don't this change if ValidateAccounts() is called
acleung1
2013/11/26 09:28:31
Yes. Since I have refactored ValidateAccounts just
| |
| 53 // Triggers a notification to all observers of the OAuth2TokenService that a | 56 // Triggers a notification to all observers of the OAuth2TokenService that a |
| 54 // refresh token is now available. This may cause observers to retry | 57 // refresh token is now available. This may cause observers to retry |
| 55 // operations that require authentication. | 58 // operations that require authentication. |
| 56 virtual void FireRefreshTokenAvailableFromJava(JNIEnv* env, | 59 virtual void FireRefreshTokenAvailableFromJava(JNIEnv* env, |
| 57 jobject obj, | 60 jobject obj, |
| 58 const jstring account_name); | 61 const jstring account_name); |
| 59 // Triggers a notification to all observers of the OAuth2TokenService that a | 62 // Triggers a notification to all observers of the OAuth2TokenService that a |
| 60 // refresh token is now available. | 63 // refresh token is now available. |
| 61 virtual void FireRefreshTokenRevokedFromJava(JNIEnv* env, | 64 virtual void FireRefreshTokenRevokedFromJava(JNIEnv* env, |
| 62 jobject obj, | 65 jobject obj, |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 79 const std::string& client_secret, | 82 const std::string& client_secret, |
| 80 const ScopeSet& scopes) OVERRIDE; | 83 const ScopeSet& scopes) OVERRIDE; |
| 81 | 84 |
| 82 // Overridden from OAuth2TokenService to intercept token fetch requests and | 85 // Overridden from OAuth2TokenService to intercept token fetch requests and |
| 83 // redirect them to the Account Manager. | 86 // redirect them to the Account Manager. |
| 84 virtual void InvalidateOAuth2Token(const std::string& account_id, | 87 virtual void InvalidateOAuth2Token(const std::string& account_id, |
| 85 const std::string& client_id, | 88 const std::string& client_id, |
| 86 const ScopeSet& scopes, | 89 const ScopeSet& scopes, |
| 87 const std::string& access_token) OVERRIDE; | 90 const std::string& access_token) OVERRIDE; |
| 88 | 91 |
| 89 // Called to notify observers when a refresh token is available. | |
| 90 virtual void FireRefreshTokenAvailable( | |
| 91 const std::string& account_id) OVERRIDE; | |
| 92 // Called to notify observers when a refresh token has been revoked. | 92 // Called to notify observers when a refresh token has been revoked. |
| 93 virtual void FireRefreshTokenRevoked(const std::string& account_id) OVERRIDE; | 93 virtual void FireRefreshTokenRevoked(const std::string& account_id) OVERRIDE; |
| 94 // Called to notify observers when refresh tokans have been loaded. | 94 // Called to notify observers when refresh tokans have been loaded. |
| 95 virtual void FireRefreshTokensLoaded() OVERRIDE; | 95 virtual void FireRefreshTokensLoaded() OVERRIDE; |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 98 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService); | 100 DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 103 #endif // CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| OLD | NEW |