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

Unified Diff: components/wifi_sync/wifi_credential_syncable_service_factory.cc

Issue 709683004: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-1-security-class
Patch Set: Created 6 years, 1 month 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: components/wifi_sync/wifi_credential_syncable_service_factory.cc
diff --git a/components/wifi_sync/wifi_credential_syncable_service_factory.cc b/components/wifi_sync/wifi_credential_syncable_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c3b4aeffb9e2fc7406c9d3d917db6561fbfdc2d1
--- /dev/null
+++ b/components/wifi_sync/wifi_credential_syncable_service_factory.cc
@@ -0,0 +1,42 @@
+// 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 "components/wifi_sync/wifi_credential_syncable_service_factory.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/wifi_sync/wifi_credential_syncable_service.h"
+
+namespace wifi_sync {
+
+// static
+WifiCredentialSyncableService*
+WifiCredentialSyncableServiceFactory::GetForProfile(Profile* profile) {
+ return static_cast<WifiCredentialSyncableService*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+WifiCredentialSyncableServiceFactory*
+WifiCredentialSyncableServiceFactory::GetInstance() {
+ return Singleton<WifiCredentialSyncableServiceFactory>::get();
+}
+
+WifiCredentialSyncableServiceFactory::WifiCredentialSyncableServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "WifiCredentialSyncableService",
+ BrowserContextDependencyManager::GetInstance()) {
+}
+
+WifiCredentialSyncableServiceFactory::~WifiCredentialSyncableServiceFactory() {
+}
+
+KeyedService* WifiCredentialSyncableServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ // TODO(quiche): Figure out if this behaves properly for multi-profile.
+ // crbug.com/430681.
stevenjb 2014/11/12 21:30:44 Hmm, we probably need to add a helper method to sr
mukesh agrawal 2014/11/13 16:24:59 I'd guess that asserting is too strong, because it
stevenjb 2014/11/13 22:55:35 Unfortunately ProfileHelper is in src/chrome so we
mukesh agrawal 2014/11/14 02:14:54 I take it the idea is that components shouldn't de
+ return new WifiCredentialSyncableService(context);
+}
+
+} // namespace wifi_sync

Powered by Google App Engine
This is Rietveld 408576698