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 CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTORY_H_
8 #include "base/memory/singleton.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
13 } // namespace content
15 namespace extensions {
17 class EntryWatcherService;
19 // Creates instances of the EntryWatcherService class.
20 class EntryWatcherServiceFactory : public BrowserContextKeyedServiceFactory {
22 // Returns a service instance singleton per |context|, after creating it
24 static EntryWatcherService* Get(content::BrowserContext* context);
26 // Returns a service instance for the context if exists. Otherwise, returns
28 static EntryWatcherService* FindExisting(content::BrowserContext* context);
30 // Gets a singleton instance of the factory.
31 static EntryWatcherServiceFactory* GetInstance();
34 friend struct DefaultSingletonTraits<EntryWatcherServiceFactory>;
36 EntryWatcherServiceFactory();
37 virtual ~EntryWatcherServiceFactory();
39 // BrowserContextKeyedServiceFactory overrides:
40 virtual KeyedService* BuildServiceInstanceFor(
41 content::BrowserContext* profile) const OVERRIDE;
42 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
44 DISALLOW_COPY_AND_ASSIGN(EntryWatcherServiceFactory);
47 } // namespace extensions
49 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_SYSTEM_ENTRY_WATCHER_SERVICE_FACTORY_H_