Invalidate scans when the host volume is unmounted.
[chromium-blink-merge.git] / components / wifi_sync / wifi_credential_syncable_service_factory.h
blob276680a6485e1a9661f9f4ceb053f7fd39a7dd71
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_
6 #define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/singleton.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
12 namespace content {
13 class BrowserContext;
16 namespace wifi_sync {
18 class WifiCredentialSyncableService;
20 // Singleton that owns all WifiCredentialSyncableServices and
21 // associates them with Profiles. Listens for the Profile's
22 // destruction notification and cleans up the associated
23 // WifiCredentialSyncableServices.
24 class WifiCredentialSyncableServiceFactory
25 : public BrowserContextKeyedServiceFactory {
26 public:
27 // Returns the SyncableService for |browser_context|, creating the
28 // SyncableService if one does not already exist.
29 static WifiCredentialSyncableService* GetForBrowserContext(
30 content::BrowserContext* browser_context);
32 // Returns the singleton instance. As this class has no public
33 // instance methods, this function is not generally useful for
34 // external callers. This function is public only so that the
35 // Singleton template can reference it.
36 static WifiCredentialSyncableServiceFactory* GetInstance();
38 private:
39 friend struct DefaultSingletonTraits<WifiCredentialSyncableServiceFactory>;
41 WifiCredentialSyncableServiceFactory();
42 ~WifiCredentialSyncableServiceFactory() override;
44 // Implementation of BrowserContextKeyedServiceFactory.
45 KeyedService* BuildServiceInstanceFor(
46 content::BrowserContext* context) const override;
48 DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableServiceFactory);
51 } // namespace wifi_sync
53 #endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_