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

Side by Side Diff: components/signin/core/browser/profile_oauth2_token_service.cc

Issue 809313009: Make the SigninErrorController a PKS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copyrighted: 2015 Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "components/signin/core/browser/profile_oauth2_token_service.h" 5 #include "components/signin/core/browser/profile_oauth2_token_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "components/signin/core/browser/signin_client.h" 11 #include "components/signin/core/browser/signin_client.h"
12 #include "components/signin/core/browser/signin_error_controller.h" 12 #include "components/signin/core/browser/signin_error_controller.h"
13 #include "google_apis/gaia/gaia_auth_util.h" 13 #include "google_apis/gaia/gaia_auth_util.h"
14 #include "net/url_request/url_request_context_getter.h" 14 #include "net/url_request/url_request_context_getter.h"
15 15
16 ProfileOAuth2TokenService::ProfileOAuth2TokenService() 16 ProfileOAuth2TokenService::ProfileOAuth2TokenService()
17 : client_(NULL) {} 17 : client_(NULL),
18 signin_error_controller_(NULL) {}
18 19
19 ProfileOAuth2TokenService::~ProfileOAuth2TokenService() { 20 ProfileOAuth2TokenService::~ProfileOAuth2TokenService() {}
20 DCHECK(!signin_error_controller_.get()) <<
21 "ProfileOAuth2TokenService::Initialize called but not "
22 "ProfileOAuth2TokenService::Shutdown";
23 }
24 21
25 void ProfileOAuth2TokenService::Initialize(SigninClient* client) { 22 void ProfileOAuth2TokenService::Initialize(
23 SigninClient* client,
24 SigninErrorController* signin_error_controller) {
26 DCHECK(client); 25 DCHECK(client);
27 DCHECK(!client_); 26 DCHECK(!client_);
27 DCHECK(signin_error_controller);
28 DCHECK(!signin_error_controller_);
28 client_ = client; 29 client_ = client;
29 30 signin_error_controller_ = signin_error_controller;
30 signin_error_controller_.reset(new SigninErrorController());
31 } 31 }
32 32
33 void ProfileOAuth2TokenService::Shutdown() { 33 void ProfileOAuth2TokenService::Shutdown() {
34 DCHECK(client_) << "Shutdown() called without matching call to Initialize()"; 34 DCHECK(client_) << "Shutdown() called without matching call to Initialize()";
35 signin_error_controller_.reset();
36 } 35 }
37 36
38 net::URLRequestContextGetter* ProfileOAuth2TokenService::GetRequestContext() { 37 net::URLRequestContextGetter* ProfileOAuth2TokenService::GetRequestContext() {
39 return NULL; 38 return NULL;
40 } 39 }
41 40
42 void ProfileOAuth2TokenService::UpdateAuthError( 41 void ProfileOAuth2TokenService::UpdateAuthError(
43 const std::string& account_id, 42 const std::string& account_id,
44 const GoogleServiceAuthError& error) { 43 const GoogleServiceAuthError& error) {
45 NOTREACHED(); 44 NOTREACHED();
(...skipping 23 matching lines...) Expand all
69 68
70 void ProfileOAuth2TokenService::UpdateCredentials( 69 void ProfileOAuth2TokenService::UpdateCredentials(
71 const std::string& account_id, 70 const std::string& account_id,
72 const std::string& refresh_token) { 71 const std::string& refresh_token) {
73 NOTREACHED(); 72 NOTREACHED();
74 } 73 }
75 74
76 void ProfileOAuth2TokenService::RevokeAllCredentials() { 75 void ProfileOAuth2TokenService::RevokeAllCredentials() {
77 // Empty implementation by default. 76 // Empty implementation by default.
78 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698