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

Unified Diff: chrome/browser/chromeos/login/oauth2_login_manager_factory.h

Issue 23678007: OAuth2LoginManager+MergeSessionThrottle hardening, multi-profle support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/chromeos/login/oauth2_login_manager_factory.h
diff --git a/chrome/browser/chromeos/login/oauth2_login_manager_factory.h b/chrome/browser/chromeos/login/oauth2_login_manager_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..8de820e744a1f26c9026e319385b34d7f4b15e2e
--- /dev/null
+++ b/chrome/browser/chromeos/login/oauth2_login_manager_factory.h
@@ -0,0 +1,45 @@
+// Copyright 2013 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_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_FACTORY_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_FACTORY_H_
+
+#include "base/memory/singleton.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
+
+class Profile;
+
+namespace chromeos {
+
+class OAuth2LoginManager;
+
+// Singleton that owns all OAuth2LoginManager and associates them with
+// Profiles. Listens for the Profile's destruction notification and cleans up
+// the associated OAuth2LoginManager.
+class OAuth2LoginManagerFactory
+ : public BrowserContextKeyedServiceFactory {
+ public:
+ // Returns the instance of OAuth2LoginManager associated with this
+ // |profile| (creates one if none exists).
+ static OAuth2LoginManager* GetForProfile(Profile* profile);
+
+ // Returns an instance of the OAuth2LoginManagerFactory singleton.
+ static OAuth2LoginManagerFactory* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<OAuth2LoginManagerFactory>;
+
+ OAuth2LoginManagerFactory();
+ virtual ~OAuth2LoginManagerFactory();
+
+ // BrowserContextKeyedServiceFactory implementation.
+ virtual BrowserContextKeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManagerFactory);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_MANAGER_FACTORY_H_
« no previous file with comments | « chrome/browser/chromeos/login/oauth2_login_manager.cc ('k') | chrome/browser/chromeos/login/oauth2_login_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698