Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: chrome/browser/signin/android_profile_oauth2_token_service.h

Issue 345703003: Use OAuth2AccessTokenFetcher implementation on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@apikey
Patch Set: rebased Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/signin/android_profile_oauth2_token_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 29 matching lines...) Expand all
40 // tests. This prevents the token service from trying to look up system 40 // tests. This prevents the token service from trying to look up system
41 // accounts which requires special permission. 41 // accounts which requires special permission.
42 static void set_is_testing_profile() { 42 static void set_is_testing_profile() {
43 is_testing_profile_ = true; 43 is_testing_profile_ = true;
44 } 44 }
45 45
46 // ProfileOAuth2TokenService overrides: 46 // ProfileOAuth2TokenService overrides:
47 virtual void Initialize(SigninClient* client) OVERRIDE; 47 virtual void Initialize(SigninClient* client) OVERRIDE;
48 virtual bool RefreshTokenIsAvailable( 48 virtual bool RefreshTokenIsAvailable(
49 const std::string& account_id) const OVERRIDE; 49 const std::string& account_id) const OVERRIDE;
50 virtual void UpdateAuthError(
51 const std::string& account_id,
52 const GoogleServiceAuthError& error) OVERRIDE;
50 virtual std::vector<std::string> GetAccounts() OVERRIDE; 53 virtual std::vector<std::string> GetAccounts() OVERRIDE;
51 54
52 // Lists account at the OS level. 55 // Lists account at the OS level.
53 std::vector<std::string> GetSystemAccounts(); 56 std::vector<std::string> GetSystemAccounts();
54 57
55 void ValidateAccounts(JNIEnv* env, 58 void ValidateAccounts(JNIEnv* env,
56 jobject obj, 59 jobject obj,
57 jstring current_account, 60 jstring current_account,
58 jboolean force_notifications); 61 jboolean force_notifications);
59 62
(...skipping 21 matching lines...) Expand all
81 84
82 // Overridden from OAuth2TokenService to complete signout of all 85 // Overridden from OAuth2TokenService to complete signout of all
83 // OA2TService aware accounts. 86 // OA2TService aware accounts.
84 virtual void RevokeAllCredentials() OVERRIDE; 87 virtual void RevokeAllCredentials() OVERRIDE;
85 88
86 protected: 89 protected:
87 friend class ProfileOAuth2TokenServiceFactory; 90 friend class ProfileOAuth2TokenServiceFactory;
88 AndroidProfileOAuth2TokenService(); 91 AndroidProfileOAuth2TokenService();
89 virtual ~AndroidProfileOAuth2TokenService(); 92 virtual ~AndroidProfileOAuth2TokenService();
90 93
91 // Overridden from OAuth2TokenService to intercept token fetch requests and
92 // redirect them to the Account Manager.
93 virtual void FetchOAuth2Token(RequestImpl* request,
94 const std::string& account_id,
95 net::URLRequestContextGetter* getter,
96 const std::string& client_id,
97 const std::string& client_secret,
98 const ScopeSet& scopes) OVERRIDE;
99
100 // Overriden from OAuth2TokenService to avoid compile errors. Has NOTREACHED()
101 // implementation as |AndroidProfileOAuth2TokenService| overrides
102 // |FetchOAuth2Token| and thus bypasses this method entirely.
103 virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher( 94 virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(
104 const std::string& account_id, 95 const std::string& account_id,
105 net::URLRequestContextGetter* getter, 96 net::URLRequestContextGetter* getter,
106 OAuth2AccessTokenConsumer* consumer) OVERRIDE; 97 OAuth2AccessTokenConsumer* consumer) OVERRIDE;
107 98
108 // Overridden from OAuth2TokenService to intercept token fetch requests and 99 // Overridden from OAuth2TokenService to intercept token fetch requests and
109 // redirect them to the Account Manager. 100 // redirect them to the Account Manager.
110 virtual void InvalidateOAuth2Token(const std::string& account_id, 101 virtual void InvalidateOAuth2Token(const std::string& account_id,
111 const std::string& client_id, 102 const std::string& client_id,
112 const ScopeSet& scopes, 103 const ScopeSet& scopes,
(...skipping 20 matching lines...) Expand all
133 124
134 private: 125 private:
135 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 126 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
136 127
137 static bool is_testing_profile_; 128 static bool is_testing_profile_;
138 129
139 DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService); 130 DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService);
140 }; 131 };
141 132
142 #endif // CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_ 133 #endif // CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/android_profile_oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698