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

Side by Side Diff: google_apis/gaia/dummy_identity_provider.cc

Issue 301973009: Add browser-global GCMDriver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build on Android. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « google_apis/gaia/dummy_identity_provider.h ('k') | google_apis/google_apis.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 #include "google_apis/gaia/dummy_identity_provider.h"
6
7 #include <string>
8
9 #include "google_apis/gaia/oauth2_token_service.h"
10
11 class DummyIdentityProvider::DummyOAuth2TokenService
12 : public OAuth2TokenService {
13 public:
14 DummyOAuth2TokenService();
15 virtual ~DummyOAuth2TokenService();
16
17 // OAuth2TokenService:
18 virtual bool RefreshTokenIsAvailable(
19 const std::string& account_id) const OVERRIDE;
20 virtual void FetchOAuth2Token(RequestImpl* request,
21 const std::string& account_id,
22 net::URLRequestContextGetter* getter,
23 const std::string& client_id,
24 const std::string& client_secret,
25 const ScopeSet& scopes) OVERRIDE;
26 virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(
27 const std::string& account_id,
28 net::URLRequestContextGetter* getter,
29 OAuth2AccessTokenConsumer* consumer) OVERRIDE;
30
31 private:
32 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
33
34 DISALLOW_COPY_AND_ASSIGN(DummyOAuth2TokenService);
35 };
36
37
38 DummyIdentityProvider::DummyOAuth2TokenService::DummyOAuth2TokenService() {
39 }
40
41 DummyIdentityProvider::DummyOAuth2TokenService::~DummyOAuth2TokenService() {
42 }
43
44 bool DummyIdentityProvider::DummyOAuth2TokenService::RefreshTokenIsAvailable(
45 const std::string& account_id) const {
46 return false;
47 }
48
49 void DummyIdentityProvider::DummyOAuth2TokenService::FetchOAuth2Token(
50 RequestImpl* request,
51 const std::string& account_id,
52 net::URLRequestContextGetter* getter,
53 const std::string& client_id,
54 const std::string& client_secret,
55 const ScopeSet& scopes) {
56 // Ignore the fetch request.
57 }
58
59 OAuth2AccessTokenFetcher*
60 DummyIdentityProvider::DummyOAuth2TokenService::CreateAccessTokenFetcher(
61 const std::string& account_id,
62 net::URLRequestContextGetter* getter,
63 OAuth2AccessTokenConsumer* consumer) {
64 return NULL;
65 }
66
67 net::URLRequestContextGetter*
68 DummyIdentityProvider::DummyOAuth2TokenService::GetRequestContext() {
69 return NULL;
70 }
71
72 DummyIdentityProvider::DummyIdentityProvider()
73 : oauth2_token_service_(new DummyOAuth2TokenService) {
74 }
75
76 DummyIdentityProvider::~DummyIdentityProvider() {
77 }
78
79 std::string DummyIdentityProvider::GetActiveUsername() {
80 return std::string();
81 }
82
83 std::string DummyIdentityProvider::GetActiveAccountId() {
84 return std::string();
85 }
86
87 OAuth2TokenService* DummyIdentityProvider::GetTokenService() {
88 return oauth2_token_service_.get();
89 }
90
91 bool DummyIdentityProvider::RequestLogin() {
92 return false;
93 }
OLDNEW
« no previous file with comments | « google_apis/gaia/dummy_identity_provider.h ('k') | google_apis/google_apis.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698