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 "chrome/browser/profiles/profile.h"
6 #include "chrome/browser/signin/chrome_signin_client_factory.h"
7 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
8 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h"
10 // TODO(blundell): Should these be namespaced?
11 KeyedService
* BuildFakeProfileOAuth2TokenService(
12 content::BrowserContext
* context
) {
13 Profile
* profile
= Profile::FromBrowserContext(context
);
14 FakeProfileOAuth2TokenService
* service
= new FakeProfileOAuth2TokenService();
16 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile
));
20 KeyedService
* BuildAutoIssuingFakeProfileOAuth2TokenService(
21 content::BrowserContext
* context
) {
22 Profile
* profile
= Profile::FromBrowserContext(context
);
23 FakeProfileOAuth2TokenService
* service
= new FakeProfileOAuth2TokenService();
24 service
->set_auto_post_fetch_response_on_message_loop(true);
26 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile
));