OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_history_client_factory.h" | 5 #include "chrome/browser/history/chrome_history_client_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/history/chrome_history_client.h" | 9 #include "chrome/browser/history/chrome_history_client.h" |
10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 "ChromeHistoryClient", | 28 "ChromeHistoryClient", |
29 BrowserContextDependencyManager::GetInstance()) { | 29 BrowserContextDependencyManager::GetInstance()) { |
30 DependsOn(BookmarkModelFactory::GetInstance()); | 30 DependsOn(BookmarkModelFactory::GetInstance()); |
31 } | 31 } |
32 | 32 |
33 ChromeHistoryClientFactory::~ChromeHistoryClientFactory() { | 33 ChromeHistoryClientFactory::~ChromeHistoryClientFactory() { |
34 } | 34 } |
35 | 35 |
36 KeyedService* ChromeHistoryClientFactory::BuildServiceInstanceFor( | 36 KeyedService* ChromeHistoryClientFactory::BuildServiceInstanceFor( |
37 content::BrowserContext* context) const { | 37 content::BrowserContext* context) const { |
38 return new ChromeHistoryClient( | 38 return new ChromeHistoryClient( |
sdefresne
2014/09/04 15:50:01
nit: you can define a profile variable here to avo
nshaik
2014/09/04 18:43:01
Done.
| |
39 BookmarkModelFactory::GetForProfile(static_cast<Profile*>(context))); | 39 BookmarkModelFactory::GetForProfile(static_cast<Profile*>(context)), |
40 static_cast<Profile*>(context), | |
41 static_cast<Profile*>(context)->GetTopSites()); | |
40 } | 42 } |
41 | 43 |
42 content::BrowserContext* ChromeHistoryClientFactory::GetBrowserContextToUse( | 44 content::BrowserContext* ChromeHistoryClientFactory::GetBrowserContextToUse( |
43 content::BrowserContext* context) const { | 45 content::BrowserContext* context) const { |
44 return chrome::GetBrowserContextRedirectedInIncognito(context); | 46 return chrome::GetBrowserContextRedirectedInIncognito(context); |
45 } | 47 } |
46 | 48 |
47 bool ChromeHistoryClientFactory::ServiceIsNULLWhileTesting() const { | 49 bool ChromeHistoryClientFactory::ServiceIsNULLWhileTesting() const { |
48 return true; | 50 return true; |
49 } | 51 } |
OLD | NEW |