Chromium Code Reviews| Index: chrome/test/base/testing_browser_process.cc |
| diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc |
| index 74b9b65d5f90f6b933f9bf4ea96f5f959cfb74b5..2739d709103bc265d7d881ee9b18febe58befbb8 100644 |
| --- a/chrome/test/base/testing_browser_process.cc |
| +++ b/chrome/test/base/testing_browser_process.cc |
| @@ -5,18 +5,23 @@ |
| #include "chrome/test/base/testing_browser_process.h" |
| #include "base/string_util.h" |
| -#include "chrome/browser/notifications/notification_ui_manager.h" |
| +#include "build/build_config.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| +#include "chrome/browser/profiles/profile_manager.h" |
| +#include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
| +#include "content/public/browser/notification_service.h" |
| +#include "net/url_request/url_request_context_getter.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +#if !defined(OS_IOS) |
| +#include "chrome/browser/notifications/notification_ui_manager.h" |
| #include "chrome/browser/prerender/prerender_tracker.h" |
| #include "chrome/browser/printing/background_printing_manager.h" |
| #include "chrome/browser/printing/print_preview_tab_controller.h" |
| -#include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" |
| -#include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
| #include "content/public/browser/notification_service.h" |
| -#include "net/url_request/url_request_context_getter.h" |
| -#include "testing/gtest/include/gtest/gtest.h" |
| +#endif |
| #if defined(ENABLE_CONFIGURATION_POLICY) |
| #include "chrome/browser/policy/browser_policy_connector.h" |
| @@ -29,7 +34,9 @@ TestingBrowserProcess::TestingBrowserProcess() |
| module_ref_count_(0), |
| app_locale_("en"), |
| local_state_(NULL), |
| +#if !defined(OS_IOS) |
| render_widget_snapshot_taker_(new RenderWidgetSnapshotTaker), |
| +#endif |
| io_thread_(NULL), |
| system_request_context_(NULL) { |
| } |
| @@ -61,11 +68,18 @@ WatchDogThread* TestingBrowserProcess::watchdog_thread() { |
| } |
| ProfileManager* TestingBrowserProcess::profile_manager() { |
| +#if defined(OS_IOS) |
|
Nico
2012/11/15 18:01:33
This file looks pretty forked now. Do you think it
stuartmorgan
2012/11/15 18:23:11
About 50% of this is temporary, because we have a
Nico
2012/11/15 18:30:13
I guess we can look at this once the temporary ifd
|
| + NOTIMPLEMENTED(); |
| + return NULL; |
| +#else |
| return profile_manager_.get(); |
| +#endif |
| } |
| void TestingBrowserProcess::SetProfileManager(ProfileManager* profile_manager) { |
| +#if !defined(OS_IOS) |
| profile_manager_.reset(profile_manager); |
| +#endif |
| } |
| PrefService* TestingBrowserProcess::local_state() { |
| @@ -89,7 +103,10 @@ policy::BrowserPolicyConnector* |
| } |
| policy::PolicyService* TestingBrowserProcess::policy_service() { |
| -#if defined(ENABLE_CONFIGURATION_POLICY) |
| +#if defined(OS_IOS) |
| + NOTIMPLEMENTED(); |
| + return NULL; |
| +#elif defined(ENABLE_CONFIGURATION_POLICY) |
| return browser_policy_connector()->GetPolicyService(); |
| #else |
| if (!policy_service_) |
| @@ -104,7 +121,12 @@ IconManager* TestingBrowserProcess::icon_manager() { |
| RenderWidgetSnapshotTaker* |
| TestingBrowserProcess::GetRenderWidgetSnapshotTaker() { |
| +#if defined(OS_IOS) |
| + NOTREACHED(); |
| + return NULL; |
| +#else |
| return render_widget_snapshot_taker_.get(); |
| +#endif |
| } |
| BackgroundModeManager* TestingBrowserProcess::background_mode_manager() { |
| @@ -116,7 +138,12 @@ StatusTray* TestingBrowserProcess::status_tray() { |
| } |
| SafeBrowsingService* TestingBrowserProcess::safe_browsing_service() { |
| +#if defined(OS_IOS) |
| + NOTIMPLEMENTED(); |
| + return NULL; |
| +#else |
| return sb_service_.get(); |
| +#endif |
| } |
| safe_browsing::ClientSideDetectionService* |
| @@ -231,9 +258,14 @@ ChromeNetLog* TestingBrowserProcess::net_log() { |
| } |
| prerender::PrerenderTracker* TestingBrowserProcess::prerender_tracker() { |
| +#if defined(OS_IOS) |
| + NOTIMPLEMENTED(); |
| + return NULL; |
| +#else |
| if (!prerender_tracker_.get()) |
| prerender_tracker_.reset(new prerender::PrerenderTracker()); |
| return prerender_tracker_.get(); |
| +#endif |
| } |
| ComponentUpdateService* TestingBrowserProcess::component_updater() { |
| @@ -245,12 +277,19 @@ CRLSetFetcher* TestingBrowserProcess::crl_set_fetcher() { |
| } |
| BookmarkPromptController* TestingBrowserProcess::bookmark_prompt_controller() { |
| +#if defined(OS_IOS) |
| + NOTIMPLEMENTED(); |
| + return NULL; |
| +#else |
| return bookmark_prompt_controller_.get(); |
| +#endif |
| } |
| void TestingBrowserProcess::SetBookmarkPromptController( |
| BookmarkPromptController* controller) { |
| +#if !defined(OS_IOS) |
| bookmark_prompt_controller_.reset(controller); |
| +#endif |
| } |
| void TestingBrowserProcess::SetSystemRequestContext( |
| @@ -269,7 +308,9 @@ void TestingBrowserProcess::SetLocalState(PrefService* local_state) { |
| // (assumedly as part of exiting the test and freeing TestingBrowserProcess) |
| // any components owned by TestingBrowserProcess that depend on local_state |
| // are also freed. |
| +#if !defined(OS_IOS) |
| notification_ui_manager_.reset(); |
| +#endif |
| #if defined(ENABLE_CONFIGURATION_POLICY) |
| SetBrowserPolicyConnector(NULL); |
| #endif |
| @@ -294,5 +335,8 @@ void TestingBrowserProcess::SetBrowserPolicyConnector( |
| void TestingBrowserProcess::SetSafeBrowsingService( |
| SafeBrowsingService* sb_service) { |
| +#if !defined(OS_IOS) |
| + NOTIMPLEMENTED(); |
| sb_service_ = sb_service; |
| +#endif |
| } |