| 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 FakeProfileOAuth2TokenService::PendingRequest::PendingRequest() { | 7 FakeProfileOAuth2TokenService::PendingRequest::PendingRequest() { |
| 8 } | 8 } |
| 9 | 9 |
| 10 FakeProfileOAuth2TokenService::PendingRequest::~PendingRequest() { | 10 FakeProfileOAuth2TokenService::PendingRequest::~PendingRequest() { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (it->request && (all_scopes || it->scopes == scope)) | 98 if (it->request && (all_scopes || it->scopes == scope)) |
| 99 it->request->InformConsumer(error, access_token, expiration); | 99 it->request->InformConsumer(error, access_token, expiration); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 std::string FakeProfileOAuth2TokenService::GetRefreshToken( | 103 std::string FakeProfileOAuth2TokenService::GetRefreshToken( |
| 104 const std::string& account_id) { | 104 const std::string& account_id) { |
| 105 return refresh_token_; | 105 return refresh_token_; |
| 106 } | 106 } |
| 107 | 107 |
| 108 net::URLRequestContextGetter* | |
| 109 FakeProfileOAuth2TokenService::GetRequestContext() { | |
| 110 return NULL; | |
| 111 } | |
| 112 | |
| 113 void FakeProfileOAuth2TokenService::RevokeCredentialsOnServer( | |
| 114 const std::string& refresh_token) { | |
| 115 // Don't try to contact server in tests. | |
| 116 } | |
| 117 | |
| 118 std::vector<FakeProfileOAuth2TokenService::PendingRequest> | 108 std::vector<FakeProfileOAuth2TokenService::PendingRequest> |
| 119 FakeProfileOAuth2TokenService::GetPendingRequests() { | 109 FakeProfileOAuth2TokenService::GetPendingRequests() { |
| 120 std::vector<PendingRequest> valid_requests; | 110 std::vector<PendingRequest> valid_requests; |
| 121 for (std::vector<PendingRequest>::iterator it = pending_requests_.begin(); | 111 for (std::vector<PendingRequest>::iterator it = pending_requests_.begin(); |
| 122 it != pending_requests_.end(); ++it) { | 112 it != pending_requests_.end(); ++it) { |
| 123 if (it->request) | 113 if (it->request) |
| 124 valid_requests.push_back(*it); | 114 valid_requests.push_back(*it); |
| 125 } | 115 } |
| 126 return valid_requests; | 116 return valid_requests; |
| 127 } | 117 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 142 pending_requests_.push_back(pending_request); | 132 pending_requests_.push_back(pending_request); |
| 143 } | 133 } |
| 144 | 134 |
| 145 void FakeProfileOAuth2TokenService::InvalidateOAuth2Token( | 135 void FakeProfileOAuth2TokenService::InvalidateOAuth2Token( |
| 146 const std::string& account_id, | 136 const std::string& account_id, |
| 147 const std::string& client_id, | 137 const std::string& client_id, |
| 148 const ScopeSet& scopes, | 138 const ScopeSet& scopes, |
| 149 const std::string& access_token) { | 139 const std::string& access_token) { |
| 150 // Do nothing, as we don't have a cache from which to remove the token. | 140 // Do nothing, as we don't have a cache from which to remove the token. |
| 151 } | 141 } |
| OLD | NEW |