Index: chrome/browser/signin/chrome_proximity_auth_client_factory.h |
diff --git a/chrome/browser/signin/chrome_proximity_auth_client_factory.h b/chrome/browser/signin/chrome_proximity_auth_client_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a28a597eb7063bc9798bed9c1c8d2f807301599b |
--- /dev/null |
+++ b/chrome/browser/signin/chrome_proximity_auth_client_factory.h |
@@ -0,0 +1,43 @@ |
+// 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. |
+ |
+#ifndef CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_FACTORY_H_ |
+#define CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_FACTORY_H_ |
+ |
+#include "base/memory/singleton.h" |
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
+ |
+class ChromeProximityAuthClient; |
+class KeyedService; |
+class Profile; |
+ |
+namespace content { |
+class BrowserContext; |
+} |
+ |
+// Singleton that owns all |ChromeProximityAuthClient| instances and associates |
+// them with profiles. Listens for each profile's destruction notification and |
Mike Lerman
2015/06/26 13:09:51
I don't see where you react to the Profile destruc
Ilya Sherman
2015/06/27 08:18:00
Whoops, you can see which class I copy/pasta'd :P
|
+// cleans up the associated SigninManager. |
+class ChromeProximityAuthClientFactory |
+ : public BrowserContextKeyedServiceFactory { |
+ public: |
+ // Returns an instance of the |ChromeProximityAuthClientFactory| singleton. |
+ static ChromeProximityAuthClientFactory* GetInstance(); |
+ |
+ // Returns the |ChromeProximityAuthClient| for the given |profile|, creating |
+ // it if necessary. |
+ static ChromeProximityAuthClient* GetForProfile(Profile* profile); |
+ |
+ private: |
+ friend struct DefaultSingletonTraits<ChromeProximityAuthClientFactory>; |
+ |
+ ChromeProximityAuthClientFactory(); |
+ ~ChromeProximityAuthClientFactory() override; |
+ |
+ // BrowserContextKeyedServiceFactory: |
+ KeyedService* BuildServiceInstanceFor( |
+ content::BrowserContext* context) const override; |
+}; |
+ |
+#endif // CHROME_BROWSER_SIGNIN_CHROME_PROXIMITY_AUTH_CLIENT_FACTORY_H_ |