Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / file_system / entry_watcher_service_factory.cc
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.
4
5 #include "chrome/browser/extensions/api/file_system/entry_watcher_service_factory.h"
6
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"
11
12 namespace extensions {
13
14 EntryWatcherServiceFactory* EntryWatcherServiceFactory::GetInstance() {
15   return Singleton<EntryWatcherServiceFactory>::get();
16 }
17
18 EntryWatcherServiceFactory::EntryWatcherServiceFactory()
19     : BrowserContextKeyedServiceFactory(
20           "EntryWatcherService",
21           BrowserContextDependencyManager::GetInstance()) {
22 }
23
24 EntryWatcherServiceFactory::~EntryWatcherServiceFactory() {
25 }
26
27 KeyedService* EntryWatcherServiceFactory::BuildServiceInstanceFor(
28     content::BrowserContext* context) const {
29   return new EntryWatcherService(Profile::FromBrowserContext(context));
30 }
31
32 bool EntryWatcherServiceFactory::ServiceIsCreatedWithBrowserContext() const {
33   // Required to restore persistent watchers as soon as the profile is loaded.
34   return true;
35 }
36
37 }  // namespace extensions