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

Unified Diff: apps/saved_devices_service_factory.cc

Issue 580963002: Add a service to track devices selected by the user. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed all of scheib@'s feedback. Created 6 years, 3 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
« no previous file with comments | « apps/saved_devices_service_factory.h ('k') | apps/saved_devices_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/saved_devices_service_factory.cc
diff --git a/apps/saved_devices_service_factory.cc b/apps/saved_devices_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1153eac0359355fa1e82d3aad449c3238a8d7357
--- /dev/null
+++ b/apps/saved_devices_service_factory.cc
@@ -0,0 +1,39 @@
+// 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 "apps/saved_devices_service_factory.h"
+
+#include "apps/saved_devices_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+namespace apps {
+
+// static
+SavedDevicesService* SavedDevicesServiceFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<SavedDevicesService*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+SavedDevicesServiceFactory* SavedDevicesServiceFactory::GetInstance() {
+ return Singleton<SavedDevicesServiceFactory>::get();
+}
+
+SavedDevicesServiceFactory::SavedDevicesServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "SavedDevicesService",
+ BrowserContextDependencyManager::GetInstance()) {
+}
+
+SavedDevicesServiceFactory::~SavedDevicesServiceFactory() {
+}
+
+KeyedService* SavedDevicesServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new SavedDevicesService(static_cast<Profile*>(profile));
+}
+
+} // namespace apps
« no previous file with comments | « apps/saved_devices_service_factory.h ('k') | apps/saved_devices_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698