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

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

Issue 1257663002: iOS factories for SigninManager and GaiaCookieManagerService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fakeSigninManager
Patch Set: Rebase 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_signin_manager_builder.cc
diff --git a/ios/chrome/browser/signin/fake_signin_manager_builder.cc b/ios/chrome/browser/signin/fake_signin_manager_builder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ce4238485be12df6c65c15831055b5a59deeb11f
--- /dev/null
+++ b/ios/chrome/browser/signin/fake_signin_manager_builder.cc
@@ -0,0 +1,34 @@
+// 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. 3 // found in the LICENSE file.
sdefresne 2015/07/24 15:31:36 huh? Can you remove the extra " 3 // found in th
droger 2015/07/24 15:57:23 Good catch, done.
+
+#include "ios/chrome/browser/signin/fake_signin_manager_builder.h"
+
+#include "components/signin/core/browser/fake_signin_manager.h"
+#include "ios/chrome/browser/signin/account_tracker_service_factory.h"
+#include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h"
+#include "ios/chrome/browser/signin/oauth2_token_service_factory.h"
+#include "ios/chrome/browser/signin/signin_client_factory.h"
+#include "ios/chrome/browser/signin/signin_manager_factory.h"
+#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
+
+namespace ios {
+
+scoped_ptr<KeyedService> BuildFakeSigninManager(
+ web::BrowserState* browser_state) {
+ ios::ChromeBrowserState* chrome_browser_state =
+ ios::ChromeBrowserState::FromBrowserState(browser_state);
+ scoped_ptr<SigninManager> manager(new FakeSigninManager(
+ SigninClientFactory::GetForBrowserState(chrome_browser_state),
+ OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state),
+ ios::AccountTrackerServiceFactory::GetForBrowserState(
+ chrome_browser_state),
+ ios::GaiaCookieManagerServiceFactory::GetForBrowserState(
+ chrome_browser_state)));
+ manager->Initialize(nullptr);
+ ios::SigninManagerFactory::GetInstance()
+ ->NotifyObserversOfSigninManagerCreationForTesting(manager.get());
+ return manager.Pass();
+}
+
+} // namespace ios

Powered by Google App Engine
This is Rietveld 408576698