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

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

Issue 484213002: Refactor HistoryService to not send NOTIFICATION_FAVICON_CHANGED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android unit tests Created 6 years, 3 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
« 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"
10 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
9 #include "chrome/browser/history/chrome_history_client.h" 11 #include "chrome/browser/history/chrome_history_client.h"
10 #include "chrome/browser/history/chrome_history_client_factory.h" 12 #include "chrome/browser/history/chrome_history_client_factory.h"
11 #include "chrome/browser/history/history_service.h" 13 #include "chrome/browser/history/history_service.h"
12 #include "chrome/browser/profiles/incognito_helpers.h" 14 #include "chrome/browser/profiles/incognito_helpers.h"
13 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
14 #include "components/bookmarks/browser/bookmark_model.h" 16 #include "components/bookmarks/browser/bookmark_model.h"
15 #include "components/keyed_service/content/browser_context_dependency_manager.h" 17 #include "components/keyed_service/content/browser_context_dependency_manager.h"
16 18
17 // static 19 // static
18 HistoryService* HistoryServiceFactory::GetForProfile( 20 HistoryService* HistoryServiceFactory::GetForProfile(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // static 56 // static
55 void HistoryServiceFactory::ShutdownForProfile(Profile* profile) { 57 void HistoryServiceFactory::ShutdownForProfile(Profile* profile) {
56 HistoryServiceFactory* factory = GetInstance(); 58 HistoryServiceFactory* factory = GetInstance();
57 factory->BrowserContextDestroyed(profile); 59 factory->BrowserContextDestroyed(profile);
58 } 60 }
59 61
60 HistoryServiceFactory::HistoryServiceFactory() 62 HistoryServiceFactory::HistoryServiceFactory()
61 : BrowserContextKeyedServiceFactory( 63 : BrowserContextKeyedServiceFactory(
62 "HistoryService", BrowserContextDependencyManager::GetInstance()) { 64 "HistoryService", BrowserContextDependencyManager::GetInstance()) {
63 DependsOn(ChromeHistoryClientFactory::GetInstance()); 65 DependsOn(ChromeHistoryClientFactory::GetInstance());
66 DependsOn(ChromeBookmarkClientFactory::GetInstance());
64 } 67 }
65 68
66 HistoryServiceFactory::~HistoryServiceFactory() { 69 HistoryServiceFactory::~HistoryServiceFactory() {
67 } 70 }
68 71
69 KeyedService* HistoryServiceFactory::BuildServiceInstanceFor( 72 KeyedService* HistoryServiceFactory::BuildServiceInstanceFor(
70 content::BrowserContext* context) const { 73 content::BrowserContext* context) const {
71 Profile* profile = static_cast<Profile*>(context); 74 Profile* profile = static_cast<Profile*>(context);
72 scoped_ptr<HistoryService> history_service(new HistoryService( 75 scoped_ptr<HistoryService> history_service(new HistoryService(
73 ChromeHistoryClientFactory::GetForProfile(profile), profile)); 76 ChromeHistoryClientFactory::GetForProfile(profile), profile));
74 if (!history_service->Init(profile->GetPath())) 77 if (!history_service->Init(profile->GetPath()))
75 return NULL; 78 return NULL;
79 ChromeBookmarkClientFactory::GetForProfile(profile)
80 ->SetHistoryService(history_service.get());
76 return history_service.release(); 81 return history_service.release();
77 } 82 }
78 83
79 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse( 84 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse(
80 content::BrowserContext* context) const { 85 content::BrowserContext* context) const {
81 return chrome::GetBrowserContextRedirectedInIncognito(context); 86 return chrome::GetBrowserContextRedirectedInIncognito(context);
82 } 87 }
83 88
84 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { 89 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const {
85 return true; 90 return true;
86 } 91 }
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