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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc

Issue 1413153007: arc-app-launcher: Minimal support for ARC app launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing links to BUILD.gn Created 5 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/ui/app_list/arc/arc_app_list_prefs_factory.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e6051ca35f533ef2331e1d34eaebcfa4e54e6a60
--- /dev/null
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
@@ -0,0 +1,45 @@
+// Copyright 2015 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/ui/app_list/arc/arc_app_list_prefs_factory.h"
+
+#include "chrome/browser/profiles/incognito_helpers.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_context.h"
+
+// static
+ArcAppListPrefs* ArcAppListPrefsFactory::GetForBrowserContext(
+ content::BrowserContext* context) {
+ return static_cast<ArcAppListPrefs*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
+}
+
+// static
+ArcAppListPrefsFactory* ArcAppListPrefsFactory::GetInstance() {
+ return base::Singleton<ArcAppListPrefsFactory>::get();
+}
+
+ArcAppListPrefsFactory::ArcAppListPrefsFactory()
+ : BrowserContextKeyedServiceFactory(
+ "ArcAppListPrefs",
+ BrowserContextDependencyManager::GetInstance()) {
+}
+
+ArcAppListPrefsFactory::~ArcAppListPrefsFactory() {
+}
+
+KeyedService* ArcAppListPrefsFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ Profile* profile = static_cast<Profile*>(context);
+ return ArcAppListPrefs::Create(profile->GetPath(), profile->GetPrefs());
+}
+
+content::BrowserContext* ArcAppListPrefsFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ // This matches the logic in ExtensionSyncServiceFactory, which uses the
+ // orginal browser context.
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
+}
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h ('k') | chrome/browser/ui/app_list/arc/arc_app_model_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698