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

Unified Diff: chrome/browser/supervised_user/child_accounts/child_account_service_factory.cc

Issue 783083002: Add support for child accounts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove CrOS for now Created 6 years 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/supervised_user/child_accounts/child_account_service_factory.cc
diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service_factory.cc b/chrome/browser/supervised_user/child_accounts/child_account_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8c54377544c2dd86dff9472c2091375ce4aa0c72
--- /dev/null
+++ b/chrome/browser/supervised_user/child_accounts/child_account_service_factory.cc
@@ -0,0 +1,40 @@
+// 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/supervised_user/child_accounts/child_account_service_factory.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
+#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+// static
+ChildAccountService* ChildAccountServiceFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<ChildAccountService*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+ChildAccountServiceFactory* ChildAccountServiceFactory::GetInstance() {
+ return Singleton<ChildAccountServiceFactory>::get();
+}
+
+ChildAccountServiceFactory::ChildAccountServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "ChildAccountService",
+ BrowserContextDependencyManager::GetInstance()) {
+ DependsOn(SupervisedUserServiceFactory::GetInstance());
+ // Indirect dependency via AccountServiceFlagFetcher.
+ DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
+ // TODO(treib): Do we have more dependencies here?
+}
+
+ChildAccountServiceFactory::~ChildAccountServiceFactory() {}
+
+KeyedService* ChildAccountServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new ChildAccountService(static_cast<Profile*>(profile));
+}

Powered by Google App Engine
This is Rietveld 408576698