| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/background/background_mode_manager.h" | 10 #include "chrome/browser/background/background_mode_manager.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/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" | 14 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
| 15 #include "chrome/test/base/testing_browser_process_platform_part.h" | 15 #include "chrome/test/base/testing_browser_process_platform_part.h" |
| 16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| 17 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "ui/message_center/message_center.h" | 19 #include "ui/message_center/message_center.h" |
| 20 | 20 |
| 21 #if !defined(OS_IOS) | 21 #if !defined(OS_IOS) |
| 22 #include "chrome/browser/notifications/notification_ui_manager.h" | 22 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 23 #include "chrome/browser/prerender/prerender_tracker.h" | 23 #include "chrome/browser/prerender/prerender_tracker.h" |
| 24 #include "chrome/browser/printing/background_printing_manager.h" | |
| 25 #include "chrome/browser/printing/print_preview_dialog_controller.h" | |
| 26 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 24 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 27 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" | 25 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" |
| 28 #endif | 26 #endif |
| 29 | 27 |
| 30 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 28 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
| 31 #include "chrome/browser/media_galleries/media_file_system_registry.h" | 29 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
| 32 #include "chrome/browser/storage_monitor/storage_monitor.h" | 30 #include "chrome/browser/storage_monitor/storage_monitor.h" |
| 33 #include "chrome/browser/storage_monitor/test_storage_monitor.h" | 31 #include "chrome/browser/storage_monitor/test_storage_monitor.h" |
| 34 #endif | 32 #endif |
| 35 | 33 |
| 36 #if defined(ENABLE_CONFIGURATION_POLICY) | 34 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 37 #include "chrome/browser/policy/browser_policy_connector.h" | 35 #include "chrome/browser/policy/browser_policy_connector.h" |
| 38 #else | 36 #else |
| 39 #include "chrome/browser/policy/policy_service_stub.h" | 37 #include "chrome/browser/policy/policy_service_stub.h" |
| 40 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 38 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 41 | 39 |
| 40 #if defined(ENABLE_FULL_PRINTING) |
| 41 #include "chrome/browser/printing/background_printing_manager.h" |
| 42 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 43 #endif |
| 44 |
| 42 // static | 45 // static |
| 43 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { | 46 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { |
| 44 return static_cast<TestingBrowserProcess*>(g_browser_process); | 47 return static_cast<TestingBrowserProcess*>(g_browser_process); |
| 45 } | 48 } |
| 46 | 49 |
| 47 TestingBrowserProcess::TestingBrowserProcess() | 50 TestingBrowserProcess::TestingBrowserProcess() |
| 48 : notification_service_(content::NotificationService::Create()), | 51 : notification_service_(content::NotificationService::Create()), |
| 49 module_ref_count_(0), | 52 module_ref_count_(0), |
| 50 app_locale_("en"), | 53 app_locale_("en"), |
| 51 #if !defined(OS_IOS) | 54 #if !defined(OS_IOS) |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 bool TestingBrowserProcess::IsShuttingDown() { | 242 bool TestingBrowserProcess::IsShuttingDown() { |
| 240 return false; | 243 return false; |
| 241 } | 244 } |
| 242 | 245 |
| 243 printing::PrintJobManager* TestingBrowserProcess::print_job_manager() { | 246 printing::PrintJobManager* TestingBrowserProcess::print_job_manager() { |
| 244 return NULL; | 247 return NULL; |
| 245 } | 248 } |
| 246 | 249 |
| 247 printing::PrintPreviewDialogController* | 250 printing::PrintPreviewDialogController* |
| 248 TestingBrowserProcess::print_preview_dialog_controller() { | 251 TestingBrowserProcess::print_preview_dialog_controller() { |
| 249 #if defined(ENABLE_PRINTING) | 252 #if defined(ENABLE_FULL_PRINTING) |
| 250 if (!print_preview_dialog_controller_.get()) | 253 if (!print_preview_dialog_controller_.get()) |
| 251 print_preview_dialog_controller_ = | 254 print_preview_dialog_controller_ = |
| 252 new printing::PrintPreviewDialogController(); | 255 new printing::PrintPreviewDialogController(); |
| 253 return print_preview_dialog_controller_.get(); | 256 return print_preview_dialog_controller_.get(); |
| 254 #else | 257 #else |
| 255 NOTIMPLEMENTED(); | 258 NOTIMPLEMENTED(); |
| 256 return NULL; | 259 return NULL; |
| 257 #endif | 260 #endif |
| 258 } | 261 } |
| 259 | 262 |
| 260 printing::BackgroundPrintingManager* | 263 printing::BackgroundPrintingManager* |
| 261 TestingBrowserProcess::background_printing_manager() { | 264 TestingBrowserProcess::background_printing_manager() { |
| 262 #if defined(ENABLE_PRINTING) | 265 #if defined(ENABLE_FULL_PRINTING) |
| 263 if (!background_printing_manager_.get()) { | 266 if (!background_printing_manager_.get()) { |
| 264 background_printing_manager_.reset( | 267 background_printing_manager_.reset( |
| 265 new printing::BackgroundPrintingManager()); | 268 new printing::BackgroundPrintingManager()); |
| 266 } | 269 } |
| 267 return background_printing_manager_.get(); | 270 return background_printing_manager_.get(); |
| 268 #else | 271 #else |
| 269 NOTIMPLEMENTED(); | 272 NOTIMPLEMENTED(); |
| 270 return NULL; | 273 return NULL; |
| 271 #endif | 274 #endif |
| 272 } | 275 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 sb_service_ = sb_service; | 414 sb_service_ = sb_service; |
| 412 #endif | 415 #endif |
| 413 } | 416 } |
| 414 | 417 |
| 415 void TestingBrowserProcess::SetStorageMonitor( | 418 void TestingBrowserProcess::SetStorageMonitor( |
| 416 scoped_ptr<chrome::StorageMonitor> storage_monitor) { | 419 scoped_ptr<chrome::StorageMonitor> storage_monitor) { |
| 417 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 420 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
| 418 storage_monitor_ = storage_monitor.Pass(); | 421 storage_monitor_ = storage_monitor.Pass(); |
| 419 #endif | 422 #endif |
| 420 } | 423 } |
| OLD | NEW |