Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / signin / fake_profile_oauth2_token_service_builder.cc
blob8d54b3147a143a09a0059082b7d1e921e510c1e1
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();
15 service->Initialize(
16 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile));
17 return service;
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);
25 service->Initialize(
26 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile));
27 return service;