• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "components/signin/core/browser/profile_oauth2_token_service.h"
6 
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
9 #include "base/stl_util.h"
10 #include "base/time/time.h"
11 #include "components/signin/core/browser/signin_error_controller.h"
12 #include "net/url_request/url_request_context_getter.h"
13 
ProfileOAuth2TokenService()14 ProfileOAuth2TokenService::ProfileOAuth2TokenService()
15     : client_(NULL) {}
16 
~ProfileOAuth2TokenService()17 ProfileOAuth2TokenService::~ProfileOAuth2TokenService() {
18   DCHECK(!signin_error_controller_.get()) <<
19       "ProfileOAuth2TokenService::Initialize called but not "
20       "ProfileOAuth2TokenService::Shutdown";
21 }
22 
Initialize(SigninClient * client)23 void ProfileOAuth2TokenService::Initialize(SigninClient* client) {
24   DCHECK(client);
25   DCHECK(!client_);
26   client_ = client;
27 
28   signin_error_controller_.reset(new SigninErrorController());
29 }
30 
Shutdown()31 void ProfileOAuth2TokenService::Shutdown() {
32   DCHECK(client_) << "Shutdown() called without matching call to Initialize()";
33   signin_error_controller_.reset();
34 }
35 
GetRequestContext()36 net::URLRequestContextGetter* ProfileOAuth2TokenService::GetRequestContext() {
37   return NULL;
38 }
39 
UpdateAuthError(const std::string & account_id,const GoogleServiceAuthError & error)40 void ProfileOAuth2TokenService::UpdateAuthError(
41     const std::string& account_id,
42     const GoogleServiceAuthError& error) {
43   NOTREACHED();
44 }
45 
GetAccounts()46 std::vector<std::string> ProfileOAuth2TokenService::GetAccounts() {
47   NOTREACHED();
48   return std::vector<std::string>();
49 }
50 
LoadCredentials(const std::string & primary_account_id)51 void ProfileOAuth2TokenService::LoadCredentials(
52     const std::string& primary_account_id) {
53   // Empty implementation by default.
54 }
55 
UpdateCredentials(const std::string & account_id,const std::string & refresh_token)56 void ProfileOAuth2TokenService::UpdateCredentials(
57     const std::string& account_id,
58     const std::string& refresh_token) {
59   NOTREACHED();
60 }
61 
RevokeAllCredentials()62 void ProfileOAuth2TokenService::RevokeAllCredentials() {
63   // Empty implementation by default.
64 }
65 
66