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

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 870063002: Componentize TopSites, TopSitesBackend, TopSitesDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@815983002
Patch Set: Fix typo Created 5 years, 10 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
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/data/History/TopSites.v1.sql » ('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/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/history_backend.h" 26 #include "chrome/browser/history/history_backend.h"
27 #include "chrome/browser/history/history_service.h" 27 #include "chrome/browser/history/history_service.h"
28 #include "chrome/browser/history/history_service_factory.h" 28 #include "chrome/browser/history/history_service_factory.h"
29 #include "chrome/browser/history/top_sites.h"
30 #include "chrome/browser/history/top_sites_factory.h" 29 #include "chrome/browser/history/top_sites_factory.h"
31 #include "chrome/browser/history/top_sites_impl.h" 30 #include "chrome/browser/history/top_sites_impl.h"
32 #include "chrome/browser/history/web_history_service_factory.h" 31 #include "chrome/browser/history/web_history_service_factory.h"
33 #include "chrome/browser/net/pref_proxy_config_tracker.h" 32 #include "chrome/browser/net/pref_proxy_config_tracker.h"
34 #include "chrome/browser/net/proxy_service_factory.h" 33 #include "chrome/browser/net/proxy_service_factory.h"
35 #include "chrome/browser/notifications/desktop_notification_service.h" 34 #include "chrome/browser/notifications/desktop_notification_service.h"
36 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 35 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
37 #include "chrome/browser/policy/profile_policy_connector.h" 36 #include "chrome/browser/policy/profile_policy_connector.h"
38 #include "chrome/browser/policy/profile_policy_connector_factory.h" 37 #include "chrome/browser/policy/profile_policy_connector_factory.h"
39 #include "chrome/browser/prefs/browser_prefs.h" 38 #include "chrome/browser/prefs/browser_prefs.h"
(...skipping 12 matching lines...) Expand all
52 #include "chrome/test/base/history_index_restore_observer.h" 51 #include "chrome/test/base/history_index_restore_observer.h"
53 #include "chrome/test/base/testing_pref_service_syncable.h" 52 #include "chrome/test/base/testing_pref_service_syncable.h"
54 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 53 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
55 #include "components/bookmarks/browser/bookmark_model.h" 54 #include "components/bookmarks/browser/bookmark_model.h"
56 #include "components/bookmarks/common/bookmark_constants.h" 55 #include "components/bookmarks/common/bookmark_constants.h"
57 #include "components/content_settings/core/browser/host_content_settings_map.h" 56 #include "components/content_settings/core/browser/host_content_settings_map.h"
58 #include "components/history/content/browser/history_database_helper.h" 57 #include "components/history/content/browser/history_database_helper.h"
59 #include "components/history/core/browser/history_constants.h" 58 #include "components/history/core/browser/history_constants.h"
60 #include "components/history/core/browser/history_database_params.h" 59 #include "components/history/core/browser/history_database_params.h"
61 #include "components/history/core/browser/history_db_task.h" 60 #include "components/history/core/browser/history_db_task.h"
61 #include "components/history/core/browser/top_sites.h"
62 #include "components/history/core/browser/top_sites_observer.h" 62 #include "components/history/core/browser/top_sites_observer.h"
63 #include "components/keyed_service/content/browser_context_dependency_manager.h" 63 #include "components/keyed_service/content/browser_context_dependency_manager.h"
64 #include "components/keyed_service/core/refcounted_keyed_service.h" 64 #include "components/keyed_service/core/refcounted_keyed_service.h"
65 #include "components/policy/core/common/policy_service.h" 65 #include "components/policy/core/common/policy_service.h"
66 #include "components/user_prefs/user_prefs.h" 66 #include "components/user_prefs/user_prefs.h"
67 #include "components/webdata_services/web_data_service_wrapper.h" 67 #include "components/webdata_services/web_data_service_wrapper.h"
68 #include "content/public/browser/browser_thread.h" 68 #include "content/public/browser/browser_thread.h"
69 #include "content/public/browser/cookie_store_factory.h" 69 #include "content/public/browser/cookie_store_factory.h"
70 #include "content/public/browser/notification_service.h" 70 #include "content/public/browser/notification_service.h"
71 #include "content/public/browser/render_process_host.h" 71 #include "content/public/browser/render_process_host.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 return new WebDataServiceWrapper( 256 return new WebDataServiceWrapper(
257 context_path, g_browser_process->GetApplicationLocale(), 257 context_path, g_browser_process->GetApplicationLocale(),
258 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 258 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
259 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), 259 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
260 sync_start_util::GetFlareForSyncableService(context_path), 260 sync_start_util::GetFlareForSyncableService(context_path),
261 &TestProfileErrorCallback); 261 &TestProfileErrorCallback);
262 } 262 }
263 263
264 scoped_refptr<RefcountedKeyedService> BuildTopSites( 264 scoped_refptr<RefcountedKeyedService> BuildTopSites(
265 content::BrowserContext* profile) { 265 content::BrowserContext* profile) {
266 history::TopSitesImpl* top_sites = 266 history::TopSitesImpl* top_sites = new history::TopSitesImpl(
267 new history::TopSitesImpl(static_cast<Profile*>(profile)); 267 static_cast<Profile*>(profile), history::PrepopulatedPageList());
268 top_sites->Init(profile->GetPath().Append(chrome::kTopSitesFilename)); 268 top_sites->Init(
269 profile->GetPath().Append(chrome::kTopSitesFilename),
270 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB));
269 return make_scoped_refptr(top_sites); 271 return make_scoped_refptr(top_sites);
270 } 272 }
271 273
272 } // namespace 274 } // namespace
273 275
274 // static 276 // static
275 #if defined(OS_CHROMEOS) 277 #if defined(OS_CHROMEOS)
276 // Must be kept in sync with 278 // Must be kept in sync with
277 // ChromeBrowserMainPartsChromeos::PreEarlyInitialization. 279 // ChromeBrowserMainPartsChromeos::PreEarlyInitialization.
278 const char TestingProfile::kTestUserProfileDir[] = "test-user"; 280 const char TestingProfile::kTestUserProfileDir[] = "test-user";
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 #if defined(ENABLE_EXTENSIONS) 1089 #if defined(ENABLE_EXTENSIONS)
1088 extension_policy_, 1090 extension_policy_,
1089 #endif 1091 #endif
1090 pref_service_.Pass(), 1092 pref_service_.Pass(),
1091 original_profile, 1093 original_profile,
1092 guest_session_, 1094 guest_session_,
1093 supervised_user_id_, 1095 supervised_user_id_,
1094 policy_service_.Pass(), 1096 policy_service_.Pass(),
1095 testing_factories_); 1097 testing_factories_);
1096 } 1098 }
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/data/History/TopSites.v1.sql » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698