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 "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/prefs/testing_pref_store.h" | 14 #include "base/prefs/testing_pref_store.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
18 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 18 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
19 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 19 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
22 #include "chrome/browser/content_settings/host_content_settings_map.h" | 22 #include "chrome/browser/content_settings/host_content_settings_map.h" |
23 #include "chrome/browser/extensions/extension_service.h" | 23 #include "chrome/browser/extensions/extension_service.h" |
24 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 24 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
25 #include "chrome/browser/extensions/extension_system_factory.h" | 25 #include "chrome/browser/extensions/extension_system_factory.h" |
26 #include "chrome/browser/extensions/test_extension_system.h" | 26 #include "chrome/browser/extensions/test_extension_system.h" |
| 27 #include "chrome/browser/favicon/chrome_favicon_client_factory.h" |
27 #include "chrome/browser/favicon/favicon_service.h" | 28 #include "chrome/browser/favicon/favicon_service.h" |
28 #include "chrome/browser/favicon/favicon_service_factory.h" | 29 #include "chrome/browser/favicon/favicon_service_factory.h" |
29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 30 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
30 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto
ry.h" | 31 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto
ry.h" |
31 #include "chrome/browser/guest_view/guest_view_manager.h" | 32 #include "chrome/browser/guest_view/guest_view_manager.h" |
32 #include "chrome/browser/history/history_backend.h" | 33 #include "chrome/browser/history/history_backend.h" |
33 #include "chrome/browser/history/history_db_task.h" | 34 #include "chrome/browser/history/history_db_task.h" |
34 #include "chrome/browser/history/history_service.h" | 35 #include "chrome/browser/history/history_service.h" |
35 #include "chrome/browser/history/history_service_factory.h" | 36 #include "chrome/browser/history/history_service_factory.h" |
36 #include "chrome/browser/history/top_sites.h" | 37 #include "chrome/browser/history/top_sites.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 // failure. | 411 // failure. |
411 if (resource_context_) { | 412 if (resource_context_) { |
412 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, | 413 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, |
413 resource_context_)); | 414 resource_context_)); |
414 resource_context_ = NULL; | 415 resource_context_ = NULL; |
415 content::RunAllPendingInMessageLoop(BrowserThread::IO); | 416 content::RunAllPendingInMessageLoop(BrowserThread::IO); |
416 } | 417 } |
417 } | 418 } |
418 | 419 |
419 static KeyedService* BuildFaviconService(content::BrowserContext* profile) { | 420 static KeyedService* BuildFaviconService(content::BrowserContext* profile) { |
420 return new FaviconService(static_cast<Profile*>(profile)); | 421 FaviconClient* favicon_client = |
| 422 ChromeFaviconClientFactory::GetForProfile(static_cast<Profile*>(profile)); |
| 423 return new FaviconService(static_cast<Profile*>(profile), favicon_client); |
421 } | 424 } |
422 | 425 |
423 void TestingProfile::CreateFaviconService() { | 426 void TestingProfile::CreateFaviconService() { |
424 // It is up to the caller to create the history service if one is needed. | 427 // It is up to the caller to create the history service if one is needed. |
425 FaviconServiceFactory::GetInstance()->SetTestingFactory( | 428 FaviconServiceFactory::GetInstance()->SetTestingFactory( |
426 this, BuildFaviconService); | 429 this, BuildFaviconService); |
427 } | 430 } |
428 | 431 |
429 static KeyedService* BuildHistoryService(content::BrowserContext* profile) { | 432 static KeyedService* BuildHistoryService(content::BrowserContext* profile) { |
430 return new HistoryService(static_cast<Profile*>(profile)); | 433 return new HistoryService(static_cast<Profile*>(profile)); |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 path_, | 988 path_, |
986 delegate_, | 989 delegate_, |
987 extension_policy_, | 990 extension_policy_, |
988 pref_service_.Pass(), | 991 pref_service_.Pass(), |
989 incognito_, | 992 incognito_, |
990 guest_session_, | 993 guest_session_, |
991 managed_user_id_, | 994 managed_user_id_, |
992 policy_service_.Pass(), | 995 policy_service_.Pass(), |
993 testing_factories_)); | 996 testing_factories_)); |
994 } | 997 } |
OLD | NEW |