| 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 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" | 5 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "chrome/browser/signin/signin_account_id_helper.h" | 8 #include "chrome/browser/signin/signin_account_id_helper.h" |
| 9 | 9 |
| 10 FakeProfileOAuth2TokenService::PendingRequest::PendingRequest() { | 10 FakeProfileOAuth2TokenService::PendingRequest::PendingRequest() { |
| 11 } | 11 } |
| 12 | 12 |
| 13 FakeProfileOAuth2TokenService::PendingRequest::~PendingRequest() { | 13 FakeProfileOAuth2TokenService::PendingRequest::~PendingRequest() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 // static | |
| 17 BrowserContextKeyedService* FakeProfileOAuth2TokenService::Build( | |
| 18 content::BrowserContext* profile) { | |
| 19 FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); | |
| 20 service->Initialize(reinterpret_cast<Profile*>(profile)); | |
| 21 return service; | |
| 22 } | |
| 23 | |
| 24 BrowserContextKeyedService* | |
| 25 FakeProfileOAuth2TokenService::BuildAutoIssuingTokenService( | |
| 26 content::BrowserContext* profile) { | |
| 27 FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); | |
| 28 service->set_auto_post_fetch_response_on_message_loop(true); | |
| 29 service->Initialize(reinterpret_cast<Profile*>(profile)); | |
| 30 return service; | |
| 31 } | |
| 32 | |
| 33 FakeProfileOAuth2TokenService::FakeProfileOAuth2TokenService() | 16 FakeProfileOAuth2TokenService::FakeProfileOAuth2TokenService() |
| 34 : auto_post_fetch_response_on_message_loop_(false) { | 17 : auto_post_fetch_response_on_message_loop_(false) { |
| 35 SigninAccountIdHelper::SetDisableForTest(true); | 18 SigninAccountIdHelper::SetDisableForTest(true); |
| 36 } | 19 } |
| 37 | 20 |
| 38 FakeProfileOAuth2TokenService::~FakeProfileOAuth2TokenService() { | 21 FakeProfileOAuth2TokenService::~FakeProfileOAuth2TokenService() { |
| 39 SigninAccountIdHelper::SetDisableForTest(false); | 22 SigninAccountIdHelper::SetDisableForTest(false); |
| 40 } | 23 } |
| 41 | 24 |
| 42 bool FakeProfileOAuth2TokenService::RefreshTokenIsAvailable( | 25 bool FakeProfileOAuth2TokenService::RefreshTokenIsAvailable( |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 171 } |
| 189 } | 172 } |
| 190 | 173 |
| 191 void FakeProfileOAuth2TokenService::InvalidateOAuth2Token( | 174 void FakeProfileOAuth2TokenService::InvalidateOAuth2Token( |
| 192 const std::string& account_id, | 175 const std::string& account_id, |
| 193 const std::string& client_id, | 176 const std::string& client_id, |
| 194 const ScopeSet& scopes, | 177 const ScopeSet& scopes, |
| 195 const std::string& access_token) { | 178 const std::string& access_token) { |
| 196 // Do nothing, as we don't have a cache from which to remove the token. | 179 // Do nothing, as we don't have a cache from which to remove the token. |
| 197 } | 180 } |
| OLD | NEW |