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

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

Issue 1209193003: [Proximity Auth] Create one ProximityAuthClient per profile, rather than one global one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/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_

Powered by Google App Engine
This is Rietveld 408576698