| 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_browser_process.h" | 5 #include "chrome/test/base/testing_browser_process.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/time/default_clock.h" | 9 #include "base/time/default_clock.h" |
| 10 #include "base/time/default_tick_clock.h" | 10 #include "base/time/default_tick_clock.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/browser_process_impl.h" | 13 #include "chrome/browser/browser_process_impl.h" |
| 14 #include "chrome/browser/lifetime/application_lifetime.h" | 14 #include "chrome/browser/lifetime/application_lifetime.h" |
| 15 #include "chrome/browser/memory/tab_manager.h" | 15 #include "chrome/browser/memory/tab_manager.h" |
| 16 #include "chrome/browser/notifications/notification_platform_bridge.h" | 16 #include "chrome/browser/notifications/notification_platform_bridge.h" |
| 17 #include "chrome/browser/notifications/notification_ui_manager.h" | 17 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 18 #include "chrome/browser/printing/print_job_manager.h" | 18 #include "chrome/browser/printing/print_job_manager.h" |
| 19 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
| 20 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 20 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 21 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
| 22 #include "chrome/common/features.h" | 22 #include "chrome/common/features.h" |
| 23 #include "chrome/test/base/testing_browser_process_platform_part.h" | 23 #include "chrome/test/base/testing_browser_process_platform_part.h" |
| 24 #include "components/network_time/network_time_tracker.h" | 24 #include "components/network_time/network_time_tracker.h" |
| 25 #include "components/policy/core/browser/browser_policy_connector.h" | 25 #include "components/policy/core/browser/browser_policy_connector.h" |
| 26 #include "components/prefs/pref_service.h" | 26 #include "components/prefs/pref_service.h" |
| 27 #include "components/subresource_filter/core/browser/ruleset_service.h" | 27 #include "components/subresource_filter/content/browser/content_ruleset_service.
h" |
| 28 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
| 29 #include "extensions/features/features.h" | 29 #include "extensions/features/features.h" |
| 30 #include "media/media_features.h" | 30 #include "media/media_features.h" |
| 31 #include "net/url_request/url_request_context_getter.h" | 31 #include "net/url_request/url_request_context_getter.h" |
| 32 #include "printing/features/features.h" | 32 #include "printing/features/features.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 34 #include "ui/message_center/message_center.h" | 34 #include "ui/message_center/message_center.h" |
| 35 | 35 |
| 36 #if BUILDFLAG(ENABLE_BACKGROUND) | 36 #if BUILDFLAG(ENABLE_BACKGROUND) |
| 37 #include "chrome/browser/background/background_mode_manager.h" | 37 #include "chrome/browser/background/background_mode_manager.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 safe_browsing::SafeBrowsingService* | 215 safe_browsing::SafeBrowsingService* |
| 216 TestingBrowserProcess::safe_browsing_service() { | 216 TestingBrowserProcess::safe_browsing_service() { |
| 217 return sb_service_.get(); | 217 return sb_service_.get(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 safe_browsing::ClientSideDetectionService* | 220 safe_browsing::ClientSideDetectionService* |
| 221 TestingBrowserProcess::safe_browsing_detection_service() { | 221 TestingBrowserProcess::safe_browsing_detection_service() { |
| 222 return nullptr; | 222 return nullptr; |
| 223 } | 223 } |
| 224 | 224 |
| 225 subresource_filter::RulesetService* | 225 subresource_filter::ContentRulesetService* |
| 226 TestingBrowserProcess::subresource_filter_ruleset_service() { | 226 TestingBrowserProcess::subresource_filter_ruleset_service() { |
| 227 return subresource_filter_ruleset_service_.get(); | 227 return subresource_filter_ruleset_service_.get(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 net::URLRequestContextGetter* TestingBrowserProcess::system_request_context() { | 230 net::URLRequestContextGetter* TestingBrowserProcess::system_request_context() { |
| 231 return system_request_context_; | 231 return system_request_context_; |
| 232 } | 232 } |
| 233 | 233 |
| 234 BrowserProcessPlatformPart* TestingBrowserProcess::platform_part() { | 234 BrowserProcessPlatformPart* TestingBrowserProcess::platform_part() { |
| 235 return platform_part_.get(); | 235 return platform_part_.get(); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 browser_policy_connector_->Shutdown(); | 454 browser_policy_connector_->Shutdown(); |
| 455 browser_policy_connector_.reset(); | 455 browser_policy_connector_.reset(); |
| 456 } | 456 } |
| 457 | 457 |
| 458 void TestingBrowserProcess::SetSafeBrowsingService( | 458 void TestingBrowserProcess::SetSafeBrowsingService( |
| 459 safe_browsing::SafeBrowsingService* sb_service) { | 459 safe_browsing::SafeBrowsingService* sb_service) { |
| 460 sb_service_ = sb_service; | 460 sb_service_ = sb_service; |
| 461 } | 461 } |
| 462 | 462 |
| 463 void TestingBrowserProcess::SetRulesetService( | 463 void TestingBrowserProcess::SetRulesetService( |
| 464 std::unique_ptr<subresource_filter::RulesetService> ruleset_service) { | 464 std::unique_ptr<subresource_filter::ContentRulesetService> |
| 465 subresource_filter_ruleset_service_.swap(ruleset_service); | 465 content_ruleset_service) { |
| 466 subresource_filter_ruleset_service_.swap(content_ruleset_service); |
| 466 } | 467 } |
| 467 | 468 |
| 468 void TestingBrowserProcess::SetRapporServiceImpl( | 469 void TestingBrowserProcess::SetRapporServiceImpl( |
| 469 rappor::RapporServiceImpl* rappor_service) { | 470 rappor::RapporServiceImpl* rappor_service) { |
| 470 rappor_service_ = rappor_service; | 471 rappor_service_ = rappor_service; |
| 471 } | 472 } |
| 472 | 473 |
| 473 void TestingBrowserProcess::SetUkmService(ukm::UkmService* ukm_service) { | 474 void TestingBrowserProcess::SetUkmService(ukm::UkmService* ukm_service) { |
| 474 ukm_service_ = ukm_service; | 475 ukm_service_ = ukm_service; |
| 475 } | 476 } |
| 476 | 477 |
| 477 void TestingBrowserProcess::SetShuttingDown(bool is_shutting_down) { | 478 void TestingBrowserProcess::SetShuttingDown(bool is_shutting_down) { |
| 478 is_shutting_down_ = is_shutting_down; | 479 is_shutting_down_ = is_shutting_down; |
| 479 } | 480 } |
| 480 | 481 |
| 481 /////////////////////////////////////////////////////////////////////////////// | 482 /////////////////////////////////////////////////////////////////////////////// |
| 482 | 483 |
| 483 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { | 484 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { |
| 484 TestingBrowserProcess::CreateInstance(); | 485 TestingBrowserProcess::CreateInstance(); |
| 485 } | 486 } |
| 486 | 487 |
| 487 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { | 488 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { |
| 488 TestingBrowserProcess::DeleteInstance(); | 489 TestingBrowserProcess::DeleteInstance(); |
| 489 } | 490 } |
| OLD | NEW |