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

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

Issue 12647008: Refactor OAuth2TokenService to have profile- and device-based implementations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase again Created 7 years, 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_
6 #define CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_
7
8 #include <string>
9
10 #include "chrome/browser/signin/profile_oauth2_token_service.h"
11
12 namespace net {
13 class URLRequestContextGetter;
14 }
15
16 class TokenService;
17
18 // A specialization of ProfileOAuth2TokenService that will be returned by
19 // ProfileOAuth2TokenServiceFactory for OS_ANDROID. This instance uses
20 // native Android features to lookup OAuth2 tokens.
21 //
22 // See |ProfileOAuth2TokenService| for usage details.
23 //
24 // Note: requests should be started from the UI thread. To start a
25 // request from other thread, please use ProfileOAuth2TokenServiceRequest.
26 class AndroidProfileOAuth2TokenService : public ProfileOAuth2TokenService {
27 public:
28 // Start the OAuth2 access token for the given scopes using
29 // ProfileSyncServiceAndroid.
30 virtual scoped_ptr<OAuth2TokenService::Request> StartRequest(
31 const OAuth2TokenService::ScopeSet& scopes,
32 OAuth2TokenService::Consumer* consumer) OVERRIDE;
33
34 virtual void InvalidateToken(const ScopeSet& scopes,
35 const std::string& invalid_token) OVERRIDE;
36
37 protected:
38 friend class ProfileOAuth2TokenServiceFactory;
39 explicit AndroidProfileOAuth2TokenService(
40 net::URLRequestContextGetter* getter);
41 virtual ~AndroidProfileOAuth2TokenService();
42
43 // Takes injected TokenService for testing.
44 bool ShouldCacheForRefreshToken(TokenService *token_service,
45 const std::string& refresh_token);
46
47 private:
48 DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService);
49 };
50
51 #endif // CHROME_BROWSER_SIGNIN_ANDROID_PROFILE_OAUTH2_TOKEN_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/signin/android_profile_oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698