Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: chrome/browser/extensions/api/file_system/entry_watcher_service_factory.cc

Issue 452043003: [ew] Add basic classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing files. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/file_system/entry_watcher_service_factory.cc
diff --git a/chrome/browser/extensions/api/file_system/entry_watcher_service_factory.cc b/chrome/browser/extensions/api/file_system/entry_watcher_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d0273e264d5518e918a9efae9d314f93d5502b54
--- /dev/null
+++ b/chrome/browser/extensions/api/file_system/entry_watcher_service_factory.cc
@@ -0,0 +1,37 @@
+// 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.
+
+#include "chrome/browser/extensions/api/file_system/entry_watcher_service_factory.h"
+
+#include "chrome/browser/extensions/api/file_system/entry_watcher_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_context.h"
+
+namespace extensions {
+
+EntryWatcherServiceFactory* EntryWatcherServiceFactory::GetInstance() {
+ return Singleton<EntryWatcherServiceFactory>::get();
+}
+
+EntryWatcherServiceFactory::EntryWatcherServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "EntryWatcherService",
+ BrowserContextDependencyManager::GetInstance()) {
+}
+
+EntryWatcherServiceFactory::~EntryWatcherServiceFactory() {
+}
+
+KeyedService* EntryWatcherServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new EntryWatcherService(Profile::FromBrowserContext(context));
+}
+
+bool EntryWatcherServiceFactory::ServiceIsCreatedWithBrowserContext() const {
+ // Required to restore persistent watchers as soon as the profile is loaded.
+ return true;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698