Chromium Code Reviews| Index: components/wifi_sync/wifi_credential_syncable_service_factory.h |
| diff --git a/components/wifi_sync/wifi_credential_syncable_service_factory.h b/components/wifi_sync/wifi_credential_syncable_service_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a18694e3f361f719a25ba0427c579b9afda4aacb |
| --- /dev/null |
| +++ b/components/wifi_sync/wifi_credential_syncable_service_factory.h |
| @@ -0,0 +1,49 @@ |
| +// 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 COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_ |
| +#define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/singleton.h" |
| +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
| + |
| +namespace wifi_sync { |
| + |
| +class WifiCredentialSyncableService; |
| + |
| +// Singleton that owns all WifiCredentialSyncableServices and |
| +// associates them with Profiles. Listens for the Profile's |
| +// destruction notification and cleans up the associated |
| +// WifiCredentialSyncableServices. |
| +class WifiCredentialSyncableServiceFactory |
| + : public BrowserContextKeyedServiceFactory { |
| + public: |
| + // Returns the SyncableService for |browser_context|, creating the |
| + // SyncableService if one does not already exist. |
| + static WifiCredentialSyncableService* GetForBrowserContext( |
| + content::BrowserContext* browser_context); |
|
erikwright (departed)
2014/12/08 21:21:36
forward-decl BrowserContext.
mukesh agrawal
2014/12/09 01:23:50
content::BrowserContext must have been declared, b
erikwright (departed)
2014/12/09 12:42:03
You are correct that the principle is that the inc
|
| + |
| + // Returns the singleton instance. As this class has no public |
| + // instance methods, this function is not generally useful for |
| + // external callers. This function is public only so that the |
| + // Singleton template can reference it. |
| + static WifiCredentialSyncableServiceFactory* GetInstance(); |
| + |
| + private: |
| + friend struct DefaultSingletonTraits<WifiCredentialSyncableServiceFactory>; |
| + |
| + WifiCredentialSyncableServiceFactory(); |
| + ~WifiCredentialSyncableServiceFactory() override; |
| + |
| + // Implementation of BrowserContextKeyedServiceFactory. |
| + KeyedService* BuildServiceInstanceFor( |
| + content::BrowserContext* context) const override; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableServiceFactory); |
| +}; |
| + |
| +} // namespace wifi_sync |
| + |
| +#endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_ |