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

Side by Side Diff: chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.cc

Issue 148513010: Eliminate ProfileOAuth2TokenService being a BCKS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
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 "chrome/browser/profiles/profile.h"
6 #include "chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h"
7
8 // static
9 BrowserContextKeyedService* FakeProfileOAuth2TokenServiceWrapper::Build(
10 content::BrowserContext* context) {
11 Profile* profile = static_cast<Profile*>(context);
12 return new FakeProfileOAuth2TokenServiceWrapper(profile, false);
13 }
14
15 // static
16 BrowserContextKeyedService*
17 FakeProfileOAuth2TokenServiceWrapper::BuildAutoIssuingTokenService(
18 content::BrowserContext* context) {
19 Profile* profile = static_cast<Profile*>(context);
20 return new FakeProfileOAuth2TokenServiceWrapper(profile, true);
21 }
22
23 FakeProfileOAuth2TokenServiceWrapper::FakeProfileOAuth2TokenServiceWrapper(
24 Profile* profile,
25 bool auto_issue_tokens) {
26 if (auto_issue_tokens)
27 service_.set_auto_post_fetch_response_on_message_loop(true);
28 service_.Initialize(reinterpret_cast<Profile*>(profile));
29 }
30
31 FakeProfileOAuth2TokenServiceWrapper::~FakeProfileOAuth2TokenServiceWrapper() {
32 service_.Shutdown();
33 }
34
35 ProfileOAuth2TokenService*
36 FakeProfileOAuth2TokenServiceWrapper::GetProfileOAuth2TokenService() {
37 return &service_;
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698