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

Side by Side Diff: chrome/browser/history/history_service_factory.cc

Issue 870143004: HistoryService::Init() receives the list of languages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-history-service
Patch Set: Address comments Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/history/history_service.cc ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/history/history_service_factory.h" 5 #include "chrome/browser/history/history_service_factory.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
9 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 9 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
10 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" 10 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 "HistoryService", BrowserContextDependencyManager::GetInstance()) { 68 "HistoryService", BrowserContextDependencyManager::GetInstance()) {
69 DependsOn(ChromeHistoryClientFactory::GetInstance()); 69 DependsOn(ChromeHistoryClientFactory::GetInstance());
70 DependsOn(ChromeBookmarkClientFactory::GetInstance()); 70 DependsOn(ChromeBookmarkClientFactory::GetInstance());
71 } 71 }
72 72
73 HistoryServiceFactory::~HistoryServiceFactory() { 73 HistoryServiceFactory::~HistoryServiceFactory() {
74 } 74 }
75 75
76 KeyedService* HistoryServiceFactory::BuildServiceInstanceFor( 76 KeyedService* HistoryServiceFactory::BuildServiceInstanceFor(
77 content::BrowserContext* context) const { 77 content::BrowserContext* context) const {
78 Profile* profile = static_cast<Profile*>(context); 78 Profile* profile = Profile::FromBrowserContext(context);
79 scoped_ptr<HistoryService> history_service(new HistoryService( 79 scoped_ptr<HistoryService> history_service(new HistoryService(
80 ChromeHistoryClientFactory::GetForProfile(profile), profile)); 80 ChromeHistoryClientFactory::GetForProfile(profile), profile));
81 if (!history_service->Init( 81 if (!history_service->Init(
82 profile->GetPrefs()->GetString(prefs::kAcceptLanguages),
82 history::HistoryDatabaseParamsForPath(profile->GetPath()))) { 83 history::HistoryDatabaseParamsForPath(profile->GetPath()))) {
83 return nullptr; 84 return nullptr;
84 } 85 }
85 ChromeBookmarkClientFactory::GetForProfile(profile) 86 ChromeBookmarkClientFactory::GetForProfile(profile)
86 ->SetHistoryService(history_service.get()); 87 ->SetHistoryService(history_service.get());
87 return history_service.release(); 88 return history_service.release();
88 } 89 }
89 90
90 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse( 91 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse(
91 content::BrowserContext* context) const { 92 content::BrowserContext* context) const {
92 return chrome::GetBrowserContextRedirectedInIncognito(context); 93 return chrome::GetBrowserContextRedirectedInIncognito(context);
93 } 94 }
94 95
95 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { 96 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const {
96 return true; 97 return true;
97 } 98 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_service.cc ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698