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/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/time/default_clock.h" | 8 #include "base/time/default_clock.h" |
9 #include "base/time/default_tick_clock.h" | 9 #include "base/time/default_tick_clock.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/browser_process_impl.h" | 12 #include "chrome/browser/browser_process_impl.h" |
13 #include "chrome/browser/lifetime/application_lifetime.h" | 13 #include "chrome/browser/lifetime/application_lifetime.h" |
14 #include "chrome/browser/memory/tab_manager.h" | 14 #include "chrome/browser/memory/tab_manager.h" |
15 #include "chrome/browser/notifications/notification_platform_bridge.h" | 15 #include "chrome/browser/notifications/notification_platform_bridge.h" |
16 #include "chrome/browser/notifications/notification_ui_manager.h" | 16 #include "chrome/browser/notifications/notification_ui_manager.h" |
17 #include "chrome/browser/printing/print_job_manager.h" | 17 #include "chrome/browser/printing/print_job_manager.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 19 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
20 #include "chrome/common/features.h" | 20 #include "chrome/common/features.h" |
21 #include "chrome/test/base/testing_browser_process_platform_part.h" | 21 #include "chrome/test/base/testing_browser_process_platform_part.h" |
22 #include "components/network_time/network_time_tracker.h" | 22 #include "components/network_time/network_time_tracker.h" |
23 #include "components/policy/core/browser/browser_policy_connector.h" | 23 #include "components/policy/core/browser/browser_policy_connector.h" |
24 #include "components/prefs/pref_service.h" | 24 #include "components/prefs/pref_service.h" |
25 #include "components/subresource_filter/core/browser/ruleset_service.h" | 25 #include "components/subresource_filter/core/browser/ruleset_service.h" |
26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
27 #include "net/url_request/url_request_context_getter.h" | 27 #include "net/url_request/url_request_context_getter.h" |
| 28 #include "printing/features/features.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
29 #include "ui/message_center/message_center.h" | 30 #include "ui/message_center/message_center.h" |
30 | 31 |
31 #if BUILDFLAG(ENABLE_BACKGROUND) | 32 #if BUILDFLAG(ENABLE_BACKGROUND) |
32 #include "chrome/browser/background/background_mode_manager.h" | 33 #include "chrome/browser/background/background_mode_manager.h" |
33 #endif | 34 #endif |
34 | 35 |
35 #if defined(ENABLE_EXTENSIONS) | 36 #if defined(ENABLE_EXTENSIONS) |
36 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" | 37 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" |
37 #include "chrome/browser/media_galleries/media_file_system_registry.h" | 38 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
38 #include "chrome/browser/ui/apps/chrome_app_window_client.h" | 39 #include "chrome/browser/ui/apps/chrome_app_window_client.h" |
39 #include "components/storage_monitor/storage_monitor.h" | 40 #include "components/storage_monitor/storage_monitor.h" |
40 #include "components/storage_monitor/test_storage_monitor.h" | 41 #include "components/storage_monitor/test_storage_monitor.h" |
41 #endif | 42 #endif |
42 | 43 |
43 #if defined(ENABLE_PRINT_PREVIEW) | 44 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
44 #include "chrome/browser/printing/background_printing_manager.h" | 45 #include "chrome/browser/printing/background_printing_manager.h" |
45 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 46 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
46 #endif | 47 #endif |
47 | 48 |
48 // static | 49 // static |
49 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { | 50 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { |
50 return static_cast<TestingBrowserProcess*>(g_browser_process); | 51 return static_cast<TestingBrowserProcess*>(g_browser_process); |
51 } | 52 } |
52 | 53 |
53 // static | 54 // static |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 248 } |
248 | 249 |
249 void TestingBrowserProcess::CreateDevToolsAutoOpener() { | 250 void TestingBrowserProcess::CreateDevToolsAutoOpener() { |
250 } | 251 } |
251 | 252 |
252 bool TestingBrowserProcess::IsShuttingDown() { | 253 bool TestingBrowserProcess::IsShuttingDown() { |
253 return is_shutting_down_; | 254 return is_shutting_down_; |
254 } | 255 } |
255 | 256 |
256 printing::PrintJobManager* TestingBrowserProcess::print_job_manager() { | 257 printing::PrintJobManager* TestingBrowserProcess::print_job_manager() { |
257 #if defined(ENABLE_PRINTING) | 258 #if BUILDFLAG(ENABLE_PRINTING) |
258 if (!print_job_manager_.get()) | 259 if (!print_job_manager_.get()) |
259 print_job_manager_.reset(new printing::PrintJobManager()); | 260 print_job_manager_.reset(new printing::PrintJobManager()); |
260 return print_job_manager_.get(); | 261 return print_job_manager_.get(); |
261 #else | 262 #else |
262 NOTIMPLEMENTED(); | 263 NOTIMPLEMENTED(); |
263 return nullptr; | 264 return nullptr; |
264 #endif | 265 #endif |
265 } | 266 } |
266 | 267 |
267 printing::PrintPreviewDialogController* | 268 printing::PrintPreviewDialogController* |
268 TestingBrowserProcess::print_preview_dialog_controller() { | 269 TestingBrowserProcess::print_preview_dialog_controller() { |
269 #if defined(ENABLE_PRINT_PREVIEW) | 270 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
270 if (!print_preview_dialog_controller_.get()) | 271 if (!print_preview_dialog_controller_.get()) |
271 print_preview_dialog_controller_ = | 272 print_preview_dialog_controller_ = |
272 new printing::PrintPreviewDialogController(); | 273 new printing::PrintPreviewDialogController(); |
273 return print_preview_dialog_controller_.get(); | 274 return print_preview_dialog_controller_.get(); |
274 #else | 275 #else |
275 NOTIMPLEMENTED(); | 276 NOTIMPLEMENTED(); |
276 return nullptr; | 277 return nullptr; |
277 #endif | 278 #endif |
278 } | 279 } |
279 | 280 |
280 printing::BackgroundPrintingManager* | 281 printing::BackgroundPrintingManager* |
281 TestingBrowserProcess::background_printing_manager() { | 282 TestingBrowserProcess::background_printing_manager() { |
282 #if defined(ENABLE_PRINT_PREVIEW) | 283 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
283 if (!background_printing_manager_.get()) { | 284 if (!background_printing_manager_.get()) { |
284 background_printing_manager_.reset( | 285 background_printing_manager_.reset( |
285 new printing::BackgroundPrintingManager()); | 286 new printing::BackgroundPrintingManager()); |
286 } | 287 } |
287 return background_printing_manager_.get(); | 288 return background_printing_manager_.get(); |
288 #else | 289 #else |
289 NOTIMPLEMENTED(); | 290 NOTIMPLEMENTED(); |
290 return nullptr; | 291 return nullptr; |
291 #endif | 292 #endif |
292 } | 293 } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 454 |
454 /////////////////////////////////////////////////////////////////////////////// | 455 /////////////////////////////////////////////////////////////////////////////// |
455 | 456 |
456 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { | 457 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { |
457 TestingBrowserProcess::CreateInstance(); | 458 TestingBrowserProcess::CreateInstance(); |
458 } | 459 } |
459 | 460 |
460 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { | 461 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { |
461 TestingBrowserProcess::DeleteInstance(); | 462 TestingBrowserProcess::DeleteInstance(); |
462 } | 463 } |
OLD | NEW |