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

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

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 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/web_history_service_factory.h" 5 #include "chrome/browser/history/web_history_service_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/content_settings/cookie_settings.h" 8 #include "chrome/browser/content_settings/cookie_settings.h"
9 #include "chrome/browser/history/web_history_service.h" 9 #include "chrome/browser/history/web_history_service.h"
10 #include "chrome/browser/signin/token_service_factory.h" 10 #include "chrome/browser/signin/token_service_factory.h"
(...skipping 22 matching lines...) Expand all
33 // static 33 // static
34 WebHistoryServiceFactory* WebHistoryServiceFactory::GetInstance() { 34 WebHistoryServiceFactory* WebHistoryServiceFactory::GetInstance() {
35 return Singleton<WebHistoryServiceFactory>::get(); 35 return Singleton<WebHistoryServiceFactory>::get();
36 } 36 }
37 37
38 // static 38 // static
39 history::WebHistoryService* WebHistoryServiceFactory::GetForProfile( 39 history::WebHistoryService* WebHistoryServiceFactory::GetForProfile(
40 Profile* profile) { 40 Profile* profile) {
41 if (IsHistorySyncEnabled(profile)) { 41 if (IsHistorySyncEnabled(profile)) {
42 return static_cast<history::WebHistoryService*>( 42 return static_cast<history::WebHistoryService*>(
43 GetInstance()->GetServiceForProfile(profile, true)); 43 GetInstance()->GetServiceForBrowserContext(profile, true));
44 } 44 }
45 return NULL; 45 return NULL;
46 } 46 }
47 47
48 ProfileKeyedService* WebHistoryServiceFactory::BuildServiceInstanceFor( 48 BrowserContextKeyedService* WebHistoryServiceFactory::BuildServiceInstanceFor(
49 content::BrowserContext* context) const { 49 content::BrowserContext* context) const {
50 Profile* profile = static_cast<Profile*>(context); 50 Profile* profile = static_cast<Profile*>(context);
51 51
52 // Ensure that the service is not instantiated or used if the user is not 52 // Ensure that the service is not instantiated or used if the user is not
53 // signed into sync, or if web history is not enabled. 53 // signed into sync, or if web history is not enabled.
54 return IsHistorySyncEnabled(profile) ? 54 return IsHistorySyncEnabled(profile) ?
55 new history::WebHistoryService(profile) : NULL; 55 new history::WebHistoryService(profile) : NULL;
56 } 56 }
57 57
58 WebHistoryServiceFactory::WebHistoryServiceFactory() 58 WebHistoryServiceFactory::WebHistoryServiceFactory()
59 : ProfileKeyedServiceFactory("WebHistoryServiceFactory", 59 : BrowserContextKeyedServiceFactory("WebHistoryServiceFactory",
60 ProfileDependencyManager::GetInstance()) { 60 BrowserContextDependencyManager::GetInstance()) {
61 DependsOn(TokenServiceFactory::GetInstance()); 61 DependsOn(TokenServiceFactory::GetInstance());
62 DependsOn(CookieSettings::Factory::GetInstance()); 62 DependsOn(CookieSettings::Factory::GetInstance());
63 } 63 }
64 64
65 WebHistoryServiceFactory::~WebHistoryServiceFactory() { 65 WebHistoryServiceFactory::~WebHistoryServiceFactory() {
66 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698