Implement multiple alternative services per origin.
[chromium-blink-merge.git] / components / signin / core / browser / profile_oauth2_token_service.cc
blobe55c2cc992c72b938f3c479c68873be296e8e40b
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.
5 #include "components/signin/core/browser/profile_oauth2_token_service.h"
7 void ProfileOAuth2TokenService::OnRefreshTokenAvailable(
8 const std::string& account_id) {
9 CancelRequestsForAccount(account_id);
10 ClearCacheForAccount(account_id);
13 void ProfileOAuth2TokenService::OnRefreshTokenRevoked(
14 const std::string& account_id) {
15 CancelRequestsForAccount(account_id);
16 ClearCacheForAccount(account_id);
19 ProfileOAuth2TokenService::ProfileOAuth2TokenService(
20 OAuth2TokenServiceDelegate* delegate)
21 : OAuth2TokenService(delegate) {
22 AddObserver(this);
25 ProfileOAuth2TokenService::~ProfileOAuth2TokenService() {
26 RemoveObserver(this);
29 void ProfileOAuth2TokenService::Shutdown() {
30 CancelAllRequests();
31 GetDelegate()->Shutdown();
34 void ProfileOAuth2TokenService::LoadCredentials(
35 const std::string& primary_account_id) {
36 GetDelegate()->LoadCredentials(primary_account_id);
39 void ProfileOAuth2TokenService::UpdateCredentials(
40 const std::string& account_id,
41 const std::string& refresh_token) {
42 GetDelegate()->UpdateCredentials(account_id, refresh_token);
45 void ProfileOAuth2TokenService::RevokeCredentials(
46 const std::string& account_id) {
47 GetDelegate()->RevokeCredentials(account_id);