| 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/file_util.h" | 9 #include "base/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/content_settings/host_content_settings_map.h" | 21 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 22 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 22 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 23 #include "chrome/browser/extensions/extension_system_factory.h" | 23 #include "chrome/browser/extensions/extension_system_factory.h" |
| 24 #include "chrome/browser/extensions/test_extension_system.h" | 24 #include "chrome/browser/extensions/test_extension_system.h" |
| 25 #include "chrome/browser/favicon/chrome_favicon_client_factory.h" | |
| 26 #include "chrome/browser/favicon/favicon_service.h" | 25 #include "chrome/browser/favicon/favicon_service.h" |
| 27 #include "chrome/browser/favicon/favicon_service_factory.h" | 26 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 28 #include "chrome/browser/history/chrome_history_client.h" | 27 #include "chrome/browser/history/chrome_history_client.h" |
| 29 #include "chrome/browser/history/chrome_history_client_factory.h" | 28 #include "chrome/browser/history/chrome_history_client_factory.h" |
| 30 #include "chrome/browser/history/history_backend.h" | 29 #include "chrome/browser/history/history_backend.h" |
| 31 #include "chrome/browser/history/history_db_task.h" | 30 #include "chrome/browser/history/history_db_task.h" |
| 32 #include "chrome/browser/history/history_service.h" | 31 #include "chrome/browser/history/history_service.h" |
| 33 #include "chrome/browser/history/history_service_factory.h" | 32 #include "chrome/browser/history/history_service_factory.h" |
| 34 #include "chrome/browser/history/top_sites.h" | 33 #include "chrome/browser/history/top_sites.h" |
| 35 #include "chrome/browser/history/web_history_service_factory.h" | 34 #include "chrome/browser/history/web_history_service_factory.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // failure. | 419 // failure. |
| 421 if (resource_context_) { | 420 if (resource_context_) { |
| 422 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, | 421 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, |
| 423 resource_context_)); | 422 resource_context_)); |
| 424 resource_context_ = NULL; | 423 resource_context_ = NULL; |
| 425 content::RunAllPendingInMessageLoop(BrowserThread::IO); | 424 content::RunAllPendingInMessageLoop(BrowserThread::IO); |
| 426 } | 425 } |
| 427 } | 426 } |
| 428 | 427 |
| 429 static KeyedService* BuildFaviconService(content::BrowserContext* profile) { | 428 static KeyedService* BuildFaviconService(content::BrowserContext* profile) { |
| 430 FaviconClient* favicon_client = | 429 return new FaviconService(static_cast<Profile*>(profile)); |
| 431 ChromeFaviconClientFactory::GetForProfile(static_cast<Profile*>(profile)); | |
| 432 return new FaviconService(static_cast<Profile*>(profile), favicon_client); | |
| 433 } | 430 } |
| 434 | 431 |
| 435 void TestingProfile::CreateFaviconService() { | 432 void TestingProfile::CreateFaviconService() { |
| 436 // It is up to the caller to create the history service if one is needed. | 433 // It is up to the caller to create the history service if one is needed. |
| 437 FaviconServiceFactory::GetInstance()->SetTestingFactory( | 434 FaviconServiceFactory::GetInstance()->SetTestingFactory( |
| 438 this, BuildFaviconService); | 435 this, BuildFaviconService); |
| 439 } | 436 } |
| 440 | 437 |
| 441 static KeyedService* BuildHistoryService(content::BrowserContext* context) { | 438 static KeyedService* BuildHistoryService(content::BrowserContext* context) { |
| 442 Profile* profile = static_cast<Profile*>(context); | 439 Profile* profile = static_cast<Profile*>(context); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 path_, | 951 path_, |
| 955 delegate_, | 952 delegate_, |
| 956 extension_policy_, | 953 extension_policy_, |
| 957 pref_service_.Pass(), | 954 pref_service_.Pass(), |
| 958 incognito_, | 955 incognito_, |
| 959 guest_session_, | 956 guest_session_, |
| 960 supervised_user_id_, | 957 supervised_user_id_, |
| 961 policy_service_.Pass(), | 958 policy_service_.Pass(), |
| 962 testing_factories_)); | 959 testing_factories_)); |
| 963 } | 960 } |
| OLD | NEW |