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

Unified Diff: chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h

Issue 148513010: Eliminate ProfileOAuth2TokenService being a BCKS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 10 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: chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h
diff --git a/chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h b/chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..f749b949d52be03aecce9fff03c66c588a4e8a79
--- /dev/null
+++ b/chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h
@@ -0,0 +1,40 @@
+// 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.
+
+#ifndef CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_WRAPPER_H_
+#define CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_WRAPPER_H_
+
+#include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+
+class Profile;
+
+// A wrapper around FakeProfileOAuth2TokenService to be able to use it as a
+// BCKS.
+class FakeProfileOAuth2TokenServiceWrapper
+ : public ProfileOAuth2TokenServiceWrapper {
+ public:
+ // Helper function to be used with
+ // BrowserContextKeyedService::SetTestingFactory().
+ static BrowserContextKeyedService* Build(content::BrowserContext* context);
+
+ // Helper function to be used with
+ // BrowserContextKeyedService::SetTestingFactory() that creates a
+ // FakeProfileOAuth2TokenService object that posts fetch responses on the
+ // current message loop.
+ static BrowserContextKeyedService* BuildAutoIssuingTokenService(
+ content::BrowserContext* context);
+
+ FakeProfileOAuth2TokenServiceWrapper(Profile* profile,
+ bool auto_issue_tokens);
+ virtual ~FakeProfileOAuth2TokenServiceWrapper();
+
+ // ProfileOAuth2TokenServiceWrapper implementation:
+ virtual ProfileOAuth2TokenService* GetProfileOAuth2TokenService() OVERRIDE;
+
+ private:
+ FakeProfileOAuth2TokenService service_;
+};
+
+#endif // CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698