| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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/favicon_service.h" | 27 #include "chrome/browser/favicon/favicon_service.h" |
| 28 #include "chrome/browser/favicon/favicon_service_factory.h" | 28 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 29 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
| 30 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto
ry.h" | 30 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_facto
ry.h" |
| 31 #include "chrome/browser/guest_view/guest_view_manager.h" | 31 #include "chrome/browser/guest_view/guest_view_manager.h" |
| 32 #include "chrome/browser/history/history_backend.h" | 32 #include "chrome/browser/history/history_backend.h" |
| 33 #include "chrome/browser/history/history_client_factory.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" |
| 37 #include "chrome/browser/history/web_history_service_factory.h" | 38 #include "chrome/browser/history/web_history_service_factory.h" |
| 38 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 39 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 39 #include "chrome/browser/net/proxy_service_factory.h" | 40 #include "chrome/browser/net/proxy_service_factory.h" |
| 40 #include "chrome/browser/notifications/desktop_notification_service.h" | 41 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 41 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 42 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 42 #include "chrome/browser/policy/profile_policy_connector.h" | 43 #include "chrome/browser/policy/profile_policy_connector.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 return new FaviconService(static_cast<Profile*>(profile)); | 421 return new FaviconService(static_cast<Profile*>(profile)); |
| 421 } | 422 } |
| 422 | 423 |
| 423 void TestingProfile::CreateFaviconService() { | 424 void TestingProfile::CreateFaviconService() { |
| 424 // It is up to the caller to create the history service if one is needed. | 425 // It is up to the caller to create the history service if one is needed. |
| 425 FaviconServiceFactory::GetInstance()->SetTestingFactory( | 426 FaviconServiceFactory::GetInstance()->SetTestingFactory( |
| 426 this, BuildFaviconService); | 427 this, BuildFaviconService); |
| 427 } | 428 } |
| 428 | 429 |
| 429 static KeyedService* BuildHistoryService(content::BrowserContext* profile) { | 430 static KeyedService* BuildHistoryService(content::BrowserContext* profile) { |
| 430 return new HistoryService(static_cast<Profile*>(profile)); | 431 return new HistoryService( |
| 432 HistoryClientFactory::GetForProfile(static_cast<Profile*>(profile)), |
| 433 static_cast<Profile*>(profile)); |
| 431 } | 434 } |
| 432 | 435 |
| 433 bool TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { | 436 bool TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { |
| 434 DestroyHistoryService(); | 437 DestroyHistoryService(); |
| 435 if (delete_file) { | 438 if (delete_file) { |
| 436 base::FilePath path = GetPath(); | 439 base::FilePath path = GetPath(); |
| 437 path = path.Append(chrome::kHistoryFilename); | 440 path = path.Append(chrome::kHistoryFilename); |
| 438 if (!base::DeleteFile(path, false) || base::PathExists(path)) | 441 if (!base::DeleteFile(path, false) || base::PathExists(path)) |
| 439 return false; | 442 return false; |
| 440 } | 443 } |
| (...skipping 544 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 |