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

Unified Diff: chrome/browser/history/chrome_history_client_factory.cc

Issue 305443004: Introduce HistoryClient interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@371825
Patch Set: Reupload with --no-find-copies Created 6 years, 7 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 | « chrome/browser/history/chrome_history_client_factory.h ('k') | chrome/browser/history/history_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/chrome_history_client_factory.cc
diff --git a/chrome/browser/history/chrome_history_client_factory.cc b/chrome/browser/history/chrome_history_client_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5e89dd686387c9930452a8311226a11b89784341
--- /dev/null
+++ b/chrome/browser/history/chrome_history_client_factory.cc
@@ -0,0 +1,45 @@
+// 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/history/chrome_history_client_factory.h"
+
+#include "chrome/browser/history/chrome_history_client.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+// static
+ChromeHistoryClient* ChromeHistoryClientFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<ChromeHistoryClient*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
+}
+
+// static
+ChromeHistoryClientFactory* ChromeHistoryClientFactory::GetInstance() {
+ return Singleton<ChromeHistoryClientFactory>::get();
+}
+
+ChromeHistoryClientFactory::ChromeHistoryClientFactory()
+ : BrowserContextKeyedServiceFactory(
+ "ChromeHistoryClient",
+ BrowserContextDependencyManager::GetInstance()) {
+}
+
+ChromeHistoryClientFactory::~ChromeHistoryClientFactory() {
+}
+
+KeyedService* ChromeHistoryClientFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new ChromeHistoryClient();
+}
+
+content::BrowserContext* ChromeHistoryClientFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
+}
+
+bool ChromeHistoryClientFactory::ServiceIsNULLWhileTesting() const {
+ return true;
+}
« no previous file with comments | « chrome/browser/history/chrome_history_client_factory.h ('k') | chrome/browser/history/history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698