| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = static_cast<Profile*>(context); |
| 218 HistoryService* history_service = new HistoryService( | 219 scoped_ptr<history::VisitDelegate> visit_delegate( |
| 219 ChromeHistoryClientFactory::GetForProfile(profile), profile); | 220 new ContentVisitDelegate(profile)); |
| 221 HistoryService* history_service = |
| 222 new HistoryService(ChromeHistoryClientFactory::GetForProfile(profile), |
| 223 visit_delegate.Pass()); |
| 220 return history_service; | 224 return history_service; |
| 221 } | 225 } |
| 222 | 226 |
| 223 KeyedService* BuildBookmarkModel(content::BrowserContext* context) { | 227 KeyedService* BuildBookmarkModel(content::BrowserContext* context) { |
| 224 Profile* profile = static_cast<Profile*>(context); | 228 Profile* profile = static_cast<Profile*>(context); |
| 225 ChromeBookmarkClient* bookmark_client = | 229 ChromeBookmarkClient* bookmark_client = |
| 226 ChromeBookmarkClientFactory::GetForProfile(profile); | 230 ChromeBookmarkClientFactory::GetForProfile(profile); |
| 227 BookmarkModel* bookmark_model = new BookmarkModel(bookmark_client); | 231 BookmarkModel* bookmark_model = new BookmarkModel(bookmark_client); |
| 228 bookmark_client->Init(bookmark_model); | 232 bookmark_client->Init(bookmark_model); |
| 229 bookmark_model->Load(profile->GetPrefs(), | 233 bookmark_model->Load(profile->GetPrefs(), |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 #if defined(ENABLE_EXTENSIONS) | 1094 #if defined(ENABLE_EXTENSIONS) |
| 1091 extension_policy_, | 1095 extension_policy_, |
| 1092 #endif | 1096 #endif |
| 1093 pref_service_.Pass(), | 1097 pref_service_.Pass(), |
| 1094 original_profile, | 1098 original_profile, |
| 1095 guest_session_, | 1099 guest_session_, |
| 1096 supervised_user_id_, | 1100 supervised_user_id_, |
| 1097 policy_service_.Pass(), | 1101 policy_service_.Pass(), |
| 1098 testing_factories_); | 1102 testing_factories_); |
| 1099 } | 1103 } |
| OLD | NEW |