OLD | NEW |
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/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/prefs/testing_pref_store.h" | 12 #include "base/prefs/testing_pref_store.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
17 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 17 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
18 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" | 18 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" |
19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
21 #include "chrome/browser/favicon/chrome_favicon_client_factory.h" | 21 #include "chrome/browser/favicon/chrome_favicon_client_factory.h" |
22 #include "chrome/browser/favicon/favicon_service.h" | 22 #include "chrome/browser/favicon/favicon_service.h" |
23 #include "chrome/browser/favicon/favicon_service_factory.h" | 23 #include "chrome/browser/favicon/favicon_service_factory.h" |
24 #include "chrome/browser/history/chrome_history_client.h" | 24 #include "chrome/browser/history/chrome_history_client.h" |
25 #include "chrome/browser/history/chrome_history_client_factory.h" | 25 #include "chrome/browser/history/chrome_history_client_factory.h" |
| 26 #include "chrome/browser/history/content_visit_delegate.h" |
26 #include "chrome/browser/history/history_backend.h" | 27 #include "chrome/browser/history/history_backend.h" |
27 #include "chrome/browser/history/history_service.h" | 28 #include "chrome/browser/history/history_service.h" |
28 #include "chrome/browser/history/history_service_factory.h" | 29 #include "chrome/browser/history/history_service_factory.h" |
29 #include "chrome/browser/history/top_sites_factory.h" | 30 #include "chrome/browser/history/top_sites_factory.h" |
30 #include "chrome/browser/history/top_sites_impl.h" | 31 #include "chrome/browser/history/top_sites_impl.h" |
31 #include "chrome/browser/history/web_history_service_factory.h" | 32 #include "chrome/browser/history/web_history_service_factory.h" |
32 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 33 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
33 #include "chrome/browser/net/proxy_service_factory.h" | 34 #include "chrome/browser/net/proxy_service_factory.h" |
34 #include "chrome/browser/notifications/desktop_notification_service.h" | 35 #include "chrome/browser/notifications/desktop_notification_service.h" |
35 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 36 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 208 } |
208 #endif | 209 #endif |
209 | 210 |
210 KeyedService* BuildFaviconService(content::BrowserContext* profile) { | 211 KeyedService* BuildFaviconService(content::BrowserContext* profile) { |
211 FaviconClient* favicon_client = | 212 FaviconClient* favicon_client = |
212 ChromeFaviconClientFactory::GetForProfile(static_cast<Profile*>(profile)); | 213 ChromeFaviconClientFactory::GetForProfile(static_cast<Profile*>(profile)); |
213 return new FaviconService(static_cast<Profile*>(profile), favicon_client); | 214 return new FaviconService(static_cast<Profile*>(profile), favicon_client); |
214 } | 215 } |
215 | 216 |
216 KeyedService* BuildHistoryService(content::BrowserContext* context) { | 217 KeyedService* BuildHistoryService(content::BrowserContext* context) { |
217 Profile* profile = static_cast<Profile*>(context); | 218 Profile* profile = Profile::FromBrowserContext(context); |
218 HistoryService* history_service = new HistoryService( | 219 HistoryService* history_service = new HistoryService( |
219 ChromeHistoryClientFactory::GetForProfile(profile), profile); | 220 ChromeHistoryClientFactory::GetForProfile(profile), |
| 221 scoped_ptr<history::VisitDelegate>(new ContentVisitDelegate(profile))); |
220 return history_service; | 222 return history_service; |
221 } | 223 } |
222 | 224 |
223 KeyedService* BuildBookmarkModel(content::BrowserContext* context) { | 225 KeyedService* BuildBookmarkModel(content::BrowserContext* context) { |
224 Profile* profile = static_cast<Profile*>(context); | 226 Profile* profile = static_cast<Profile*>(context); |
225 ChromeBookmarkClient* bookmark_client = | 227 ChromeBookmarkClient* bookmark_client = |
226 ChromeBookmarkClientFactory::GetForProfile(profile); | 228 ChromeBookmarkClientFactory::GetForProfile(profile); |
227 BookmarkModel* bookmark_model = new BookmarkModel(bookmark_client); | 229 BookmarkModel* bookmark_model = new BookmarkModel(bookmark_client); |
228 bookmark_client->Init(bookmark_model); | 230 bookmark_client->Init(bookmark_model); |
229 bookmark_model->Load(profile->GetPrefs(), | 231 bookmark_model->Load(profile->GetPrefs(), |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 #if defined(ENABLE_EXTENSIONS) | 1086 #if defined(ENABLE_EXTENSIONS) |
1085 extension_policy_, | 1087 extension_policy_, |
1086 #endif | 1088 #endif |
1087 pref_service_.Pass(), | 1089 pref_service_.Pass(), |
1088 original_profile, | 1090 original_profile, |
1089 guest_session_, | 1091 guest_session_, |
1090 supervised_user_id_, | 1092 supervised_user_id_, |
1091 policy_service_.Pass(), | 1093 policy_service_.Pass(), |
1092 testing_factories_); | 1094 testing_factories_); |
1093 } | 1095 } |
OLD | NEW |