| 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" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" | 39 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" |
| 40 #include "chrome/browser/media_galleries/media_file_system_registry.h" | 40 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
| 41 #include "chrome/browser/ui/apps/chrome_app_window_client.h" | 41 #include "chrome/browser/ui/apps/chrome_app_window_client.h" |
| 42 #include "components/storage_monitor/storage_monitor.h" | 42 #include "components/storage_monitor/storage_monitor.h" |
| 43 #include "components/storage_monitor/test_storage_monitor.h" | 43 #include "components/storage_monitor/test_storage_monitor.h" |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 46 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 47 #include "chrome/browser/printing/background_printing_manager.h" | 47 #include "chrome/browser/printing/background_printing_manager.h" |
| 48 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 48 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 49 #include "chrome/browser/printing/print_preview_test.h" |
| 49 #endif | 50 #endif |
| 50 | 51 |
| 51 // static | 52 // static |
| 52 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { | 53 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { |
| 53 return static_cast<TestingBrowserProcess*>(g_browser_process); | 54 return static_cast<TestingBrowserProcess*>(g_browser_process); |
| 54 } | 55 } |
| 55 | 56 |
| 56 // static | 57 // static |
| 57 void TestingBrowserProcess::CreateInstance() { | 58 void TestingBrowserProcess::CreateInstance() { |
| 58 DCHECK(!g_browser_process); | 59 DCHECK(!g_browser_process); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 return print_job_manager_.get(); | 264 return print_job_manager_.get(); |
| 264 #else | 265 #else |
| 265 NOTIMPLEMENTED(); | 266 NOTIMPLEMENTED(); |
| 266 return nullptr; | 267 return nullptr; |
| 267 #endif | 268 #endif |
| 268 } | 269 } |
| 269 | 270 |
| 270 printing::PrintPreviewDialogController* | 271 printing::PrintPreviewDialogController* |
| 271 TestingBrowserProcess::print_preview_dialog_controller() { | 272 TestingBrowserProcess::print_preview_dialog_controller() { |
| 272 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 273 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 273 if (!print_preview_dialog_controller_.get()) | 274 if (!print_preview_dialog_controller_.get()) { |
| 274 print_preview_dialog_controller_ = | 275 print_preview_dialog_controller_ = |
| 275 new printing::PrintPreviewDialogController(); | 276 new printing::PrintPreviewDialogController(); |
| 277 } |
| 276 return print_preview_dialog_controller_.get(); | 278 return print_preview_dialog_controller_.get(); |
| 277 #else | 279 #else |
| 278 NOTIMPLEMENTED(); | 280 NOTIMPLEMENTED(); |
| 279 return nullptr; | 281 return nullptr; |
| 280 #endif | 282 #endif |
| 281 } | 283 } |
| 282 | 284 |
| 285 void TestingBrowserProcess::SetPrintPreviewDialogController( |
| 286 printing::PrintPreviewDialogController* controller) { |
| 287 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 288 print_preview_dialog_controller_ = controller; |
| 289 #else |
| 290 NOTIMPLEMENTED(); |
| 291 #endif |
| 292 } |
| 293 |
| 283 printing::BackgroundPrintingManager* | 294 printing::BackgroundPrintingManager* |
| 284 TestingBrowserProcess::background_printing_manager() { | 295 TestingBrowserProcess::background_printing_manager() { |
| 285 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 296 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 286 if (!background_printing_manager_.get()) { | 297 if (!background_printing_manager_.get()) { |
| 287 background_printing_manager_.reset( | 298 background_printing_manager_.reset( |
| 288 new printing::BackgroundPrintingManager()); | 299 new printing::BackgroundPrintingManager()); |
| 289 } | 300 } |
| 290 return background_printing_manager_.get(); | 301 return background_printing_manager_.get(); |
| 291 #else | 302 #else |
| 292 NOTIMPLEMENTED(); | 303 NOTIMPLEMENTED(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 467 |
| 457 /////////////////////////////////////////////////////////////////////////////// | 468 /////////////////////////////////////////////////////////////////////////////// |
| 458 | 469 |
| 459 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { | 470 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { |
| 460 TestingBrowserProcess::CreateInstance(); | 471 TestingBrowserProcess::CreateInstance(); |
| 461 } | 472 } |
| 462 | 473 |
| 463 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { | 474 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { |
| 464 TestingBrowserProcess::DeleteInstance(); | 475 TestingBrowserProcess::DeleteInstance(); |
| 465 } | 476 } |
| OLD | NEW |