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

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

Issue 1205603002: Remove dependency of HistoryServiceFactory on ChromeBookmarkClientFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_history_client
Patch Set: Remove change to BookmarkModelObserver and use BaseBookmarkModelObserver Created 5 years, 6 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
Index: chrome/browser/history/history_service_factory.cc
diff --git a/chrome/browser/history/history_service_factory.cc b/chrome/browser/history/history_service_factory.cc
index 373419a9d0fd11acd9693bfc07eb79520fb63b44..b9847c1ccc9342a268871a93419c5a68c78079ce 100644
--- a/chrome/browser/history/history_service_factory.cc
+++ b/chrome/browser/history/history_service_factory.cc
@@ -6,8 +6,6 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
-#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
@@ -25,9 +23,10 @@ history::HistoryService* HistoryServiceFactory::GetForProfile(
Profile* profile,
ServiceAccessType sat) {
// If saving history is disabled, only allow explicit access.
- if (profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) &&
- sat != ServiceAccessType::EXPLICIT_ACCESS)
- return NULL;
+ if (sat != ServiceAccessType::EXPLICIT_ACCESS &&
+ profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) {
+ return nullptr;
+ }
return static_cast<history::HistoryService*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
@@ -38,9 +37,10 @@ history::HistoryService* HistoryServiceFactory::GetForProfileIfExists(
Profile* profile,
ServiceAccessType sat) {
// If saving history is disabled, only allow explicit access.
- if (profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) &&
- sat != ServiceAccessType::EXPLICIT_ACCESS)
- return NULL;
+ if (sat != ServiceAccessType::EXPLICIT_ACCESS &&
+ profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) {
+ return nullptr;
+ }
return static_cast<history::HistoryService*>(
GetInstance()->GetServiceForBrowserContext(profile, false));
@@ -69,7 +69,6 @@ HistoryServiceFactory::HistoryServiceFactory()
"HistoryService",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(BookmarkModelFactory::GetInstance());
- DependsOn(ChromeBookmarkClientFactory::GetInstance());
}
HistoryServiceFactory::~HistoryServiceFactory() {
@@ -88,8 +87,6 @@ KeyedService* HistoryServiceFactory::BuildServiceInstanceFor(
history::HistoryDatabaseParamsForPath(profile->GetPath()))) {
return nullptr;
}
- ChromeBookmarkClientFactory::GetForProfile(profile)
- ->SetHistoryService(history_service.get());
return history_service.release();
}

Powered by Google App Engine
This is Rietveld 408576698