diff options
author | Ben Murdoch <benm@google.com> | 2014-03-31 11:51:25 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2014-03-31 11:51:25 +0100 |
commit | effb81e5f8246d0db0270817048dc992db66e9fb (patch) | |
tree | cc45ced7dfde038c8f3d022ee1eeac207a68761e /chrome/browser/signin/fake_profile_oauth2_token_service_builder.cc | |
parent | 4d26337013537c1acafbcb63b9b2b7e404c3adc9 (diff) | |
download | chromium_org-effb81e5f8246d0db0270817048dc992db66e9fb.tar.gz |
Merge from Chromium at DEPS revision 260458
This commit was generated by merge_to_master.py.
Change-Id: I140fa91b7f09c8efba4424e99ccb87b94a11d022
Diffstat (limited to 'chrome/browser/signin/fake_profile_oauth2_token_service_builder.cc')
-rw-r--r-- | chrome/browser/signin/fake_profile_oauth2_token_service_builder.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/chrome/browser/signin/fake_profile_oauth2_token_service_builder.cc b/chrome/browser/signin/fake_profile_oauth2_token_service_builder.cc new file mode 100644 index 0000000000..8d54b3147a --- /dev/null +++ b/chrome/browser/signin/fake_profile_oauth2_token_service_builder.cc @@ -0,0 +1,28 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/signin/chrome_signin_client_factory.h" +#include "chrome/browser/signin/fake_profile_oauth2_token_service.h" +#include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" + +// TODO(blundell): Should these be namespaced? +KeyedService* BuildFakeProfileOAuth2TokenService( + content::BrowserContext* context) { + Profile* profile = Profile::FromBrowserContext(context); + FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); + service->Initialize( + ChromeSigninClientFactory::GetInstance()->GetForProfile(profile)); + return service; +} + +KeyedService* BuildAutoIssuingFakeProfileOAuth2TokenService( + content::BrowserContext* context) { + Profile* profile = Profile::FromBrowserContext(context); + FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); + service->set_auto_post_fetch_response_on_message_loop(true); + service->Initialize( + ChromeSigninClientFactory::GetInstance()->GetForProfile(profile)); + return service; +} |