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 #include "chrome/browser/extensions/api/file_system/entry_watcher_service_factory.h"
7 #include "chrome/browser/extensions/api/file_system/entry_watcher_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "content/public/browser/browser_context.h"
12 namespace extensions {
14 EntryWatcherServiceFactory* EntryWatcherServiceFactory::GetInstance() {
15 return Singleton<EntryWatcherServiceFactory>::get();
18 EntryWatcherServiceFactory::EntryWatcherServiceFactory()
19 : BrowserContextKeyedServiceFactory(
20 "EntryWatcherService",
21 BrowserContextDependencyManager::GetInstance()) {
24 EntryWatcherServiceFactory::~EntryWatcherServiceFactory() {
27 KeyedService* EntryWatcherServiceFactory::BuildServiceInstanceFor(
28 content::BrowserContext* context) const {
29 return new EntryWatcherService(Profile::FromBrowserContext(context));
32 bool EntryWatcherServiceFactory::ServiceIsCreatedWithBrowserContext() const {
33 // Required to restore persistent watchers as soon as the profile is loaded.
37 } // namespace extensions