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

Unified Diff: ios/chrome/browser/signin/fake_oauth2_token_service_builder.cc

Issue 1251463002: iOS factories for ProfileOAuth2TokenService and AccountTrackerService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@componentizeOAuth2
Patch Set: Review comments Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/signin/fake_oauth2_token_service_builder.cc
diff --git a/ios/chrome/browser/signin/fake_oauth2_token_service_builder.cc b/ios/chrome/browser/signin/fake_oauth2_token_service_builder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8c7cae2d4f10e88cd82d96341bd5d873aeb55e32
--- /dev/null
+++ b/ios/chrome/browser/signin/fake_oauth2_token_service_builder.cc
@@ -0,0 +1,25 @@
+// Copyright 2015 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 "ios/chrome/browser/signin/fake_oauth2_token_service_builder.h"
+
+#include "components/signin/core/browser/fake_profile_oauth2_token_service.h"
+#include "components/signin/ios/browser/fake_profile_oauth2_token_service_ios_delegate.h"
+#include "ios/chrome/browser/signin/signin_client_factory.h"
+#include "ios/chrome/browser/signin/signin_error_controller_factory.h"
+#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
+#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
+
+scoped_ptr<KeyedService> BuildFakeOAuth2TokenService(
+ web::BrowserState* context) {
+ ios::ChromeBrowserState* browser_state =
+ ios::ChromeBrowserState::FromBrowserState(context);
+ OAuth2TokenServiceDelegate* delegate =
+ new FakeProfileOAuth2TokenServiceIOSDelegate(
+ SigninClientFactory::GetForBrowserState(browser_state),
+ ios::GetChromeBrowserProvider()
+ ->GetProfileOAuth2TokenServiceIOSProvider(),
+ ios::SigninErrorControllerFactory::GetForBrowserState(browser_state));
+ return make_scoped_ptr(new FakeProfileOAuth2TokenService(delegate));
+}

Powered by Google App Engine
This is Rietveld 408576698