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

Unified Diff: components/signin/core/browser/fake_signin_manager.h

Issue 1257623002: Componentize FakeSigninManager and SigninManager prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment 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
« no previous file with comments | « components/signin/core/browser/BUILD.gn ('k') | components/signin/core/browser/fake_signin_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/fake_signin_manager.h
diff --git a/chrome/browser/signin/fake_signin_manager.h b/components/signin/core/browser/fake_signin_manager.h
similarity index 68%
rename from chrome/browser/signin/fake_signin_manager.h
rename to components/signin/core/browser/fake_signin_manager.h
index 7128ae41309704b19471ea4f4a5eedf0834d020b..b12f48dcd1ad65667cb262980df0e3473ec88538 100644
--- a/chrome/browser/signin/fake_signin_manager.h
+++ b/components/signin/core/browser/fake_signin_manager.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_
-#define CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_
+#ifndef COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_
+#define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_
#include <string>
@@ -12,12 +12,6 @@
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/signin_metrics.h"
-namespace content {
-class BrowserContext;
-}
-
-class Profile;
-
// SigninManager to use for testing. Tests should use the type
// SigninManagerForTesting to ensure that the right type for their platform is
// used.
@@ -25,15 +19,9 @@ class Profile;
// Overrides InitTokenService to do-nothing in tests.
class FakeSigninManagerBase : public SigninManagerBase {
public:
- explicit FakeSigninManagerBase(Profile* profile);
+ FakeSigninManagerBase(SigninClient* client,
+ AccountTrackerService* account_tracker_service);
~FakeSigninManagerBase() override;
-
- // Helper function to be used with
- // KeyedService::SetTestingFactory(). In order to match
- // the API of SigninManagerFactory::GetForProfile(), returns a
- // FakeSigninManagerBase* on ChromeOS, and a FakeSigninManager* on all other
- // platforms. The returned instance is initialized.
- static scoped_ptr<KeyedService> Build(content::BrowserContext* context);
};
#if !defined(OS_CHROMEOS)
@@ -42,7 +30,10 @@ class FakeSigninManagerBase : public SigninManagerBase {
// and accepts the credentials provided to StartSignIn.
class FakeSigninManager : public SigninManager {
public:
- explicit FakeSigninManager(Profile* profile);
+ FakeSigninManager(SigninClient* client,
+ ProfileOAuth2TokenService* token_service,
+ AccountTrackerService* account_tracker_service,
+ GaiaCookieManagerService* cookie_manager_service);
~FakeSigninManager() override;
void set_auth_in_progress(const std::string& account_id) {
@@ -55,6 +46,8 @@ class FakeSigninManager : public SigninManager {
const std::string& username,
const std::string& password);
+ void ForceSignOut();
+
void FailSignin(const GoogleServiceAuthError& error);
void StartSignInWithRefreshToken(
@@ -74,10 +67,4 @@ class FakeSigninManager : public SigninManager {
#endif // !defined (OS_CHROMEOS)
-#if defined(OS_CHROMEOS)
-typedef FakeSigninManagerBase FakeSigninManagerForTesting;
-#else
-typedef FakeSigninManager FakeSigninManagerForTesting;
-#endif
-
-#endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_
+#endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_SIGNIN_MANAGER_H_
« no previous file with comments | « components/signin/core/browser/BUILD.gn ('k') | components/signin/core/browser/fake_signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698