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

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

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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 | Annotate | Revision Log
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.h" 8 #include "chrome/browser/bookmarks/bookmark_model.h"
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
10 #include "chrome/browser/history/history_service.h" 10 #include "chrome/browser/history/history_service.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 HistoryServiceFactory::HistoryServiceFactory() 57 HistoryServiceFactory::HistoryServiceFactory()
58 : ProfileKeyedServiceFactory( 58 : ProfileKeyedServiceFactory(
59 "HistoryService", ProfileDependencyManager::GetInstance()) { 59 "HistoryService", ProfileDependencyManager::GetInstance()) {
60 DependsOn(BookmarkModelFactory::GetInstance()); 60 DependsOn(BookmarkModelFactory::GetInstance());
61 } 61 }
62 62
63 HistoryServiceFactory::~HistoryServiceFactory() { 63 HistoryServiceFactory::~HistoryServiceFactory() {
64 } 64 }
65 65
66 ProfileKeyedService* 66 ProfileKeyedService*
67 HistoryServiceFactory::BuildServiceInstanceFor(Profile* profile) const { 67 HistoryServiceFactory::BuildServiceInstanceFor(
68 content::BrowserContext* context) const {
69 Profile* profile = static_cast<Profile*>(context);
68 HistoryService* history_service = new HistoryService(profile); 70 HistoryService* history_service = new HistoryService(profile);
69 if (!history_service->Init(profile->GetPath(), 71 if (!history_service->Init(profile->GetPath(),
70 BookmarkModelFactory::GetForProfile(profile))) { 72 BookmarkModelFactory::GetForProfile(profile))) {
71 return NULL; 73 return NULL;
72 } 74 }
73 return history_service; 75 return history_service;
74 } 76 }
75 77
76 bool HistoryServiceFactory::ServiceRedirectedInIncognito() const { 78 bool HistoryServiceFactory::ServiceRedirectedInIncognito() const {
77 return true; 79 return true;
78 } 80 }
79 81
80 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { 82 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const {
81 return true; 83 return true;
82 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698