| 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/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" | 12 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
| 13 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
| 14 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 #if !defined(OS_IOS) | 17 #if !defined(OS_IOS) |
| 18 #include "chrome/browser/media_galleries/media_file_system_registry.h" | 18 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
| 19 #include "chrome/browser/notifications/notification_ui_manager.h" | 19 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 20 #include "chrome/browser/prerender/prerender_tracker.h" | 20 #include "chrome/browser/prerender/prerender_tracker.h" |
| 21 #include "chrome/browser/printing/background_printing_manager.h" | 21 #include "chrome/browser/printing/background_printing_manager.h" |
| 22 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 22 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 23 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 23 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 24 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" | 24 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 #if defined(OS_CHROMEOS) | |
| 28 #include "chrome/browser/chromeos/settings/device_settings_service.h" | |
| 29 #endif | |
| 30 | |
| 31 #if defined(ENABLE_CONFIGURATION_POLICY) | 27 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 32 #include "chrome/browser/policy/browser_policy_connector.h" | 28 #include "chrome/browser/policy/browser_policy_connector.h" |
| 33 #else | 29 #else |
| 34 #include "chrome/browser/policy/policy_service_stub.h" | 30 #include "chrome/browser/policy/policy_service_stub.h" |
| 35 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 31 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 36 | 32 |
| 37 #if defined(ENABLE_MESSAGE_CENTER) | 33 #if defined(ENABLE_MESSAGE_CENTER) |
| 38 #include "ui/message_center/message_center.h" | 34 #include "ui/message_center/message_center.h" |
| 39 #endif | 35 #endif |
| 40 | 36 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 369 |
| 374 void TestingBrowserProcess::SetIOThread(IOThread* io_thread) { | 370 void TestingBrowserProcess::SetIOThread(IOThread* io_thread) { |
| 375 io_thread_ = io_thread; | 371 io_thread_ = io_thread; |
| 376 } | 372 } |
| 377 | 373 |
| 378 void TestingBrowserProcess::SetBrowserPolicyConnector( | 374 void TestingBrowserProcess::SetBrowserPolicyConnector( |
| 379 policy::BrowserPolicyConnector* connector) { | 375 policy::BrowserPolicyConnector* connector) { |
| 380 #if defined(ENABLE_CONFIGURATION_POLICY) | 376 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 381 if (browser_policy_connector_) { | 377 if (browser_policy_connector_) { |
| 382 browser_policy_connector_->Shutdown(); | 378 browser_policy_connector_->Shutdown(); |
| 383 #if defined(OS_CHROMEOS) | |
| 384 if (!connector) { | |
| 385 // If the connector was created then it accessed this global singleton. | |
| 386 // It must also be Shutdown() for a clean teardown. | |
| 387 chromeos::DeviceSettingsService::Get()->Shutdown(); | |
| 388 } | |
| 389 #endif | |
| 390 } | 379 } |
| 391 browser_policy_connector_.reset(connector); | 380 browser_policy_connector_.reset(connector); |
| 392 #else | 381 #else |
| 393 CHECK(false); | 382 CHECK(false); |
| 394 #endif | 383 #endif |
| 395 } | 384 } |
| 396 | 385 |
| 397 void TestingBrowserProcess::SetSafeBrowsingService( | 386 void TestingBrowserProcess::SetSafeBrowsingService( |
| 398 SafeBrowsingService* sb_service) { | 387 SafeBrowsingService* sb_service) { |
| 399 #if !defined(OS_IOS) | 388 #if !defined(OS_IOS) |
| 400 NOTIMPLEMENTED(); | 389 NOTIMPLEMENTED(); |
| 401 sb_service_ = sb_service; | 390 sb_service_ = sb_service; |
| 402 #endif | 391 #endif |
| 403 } | 392 } |
| OLD | NEW |