| 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 // An implementation of BrowserProcess for unit tests that fails for most | 5 // An implementation of BrowserProcess for unit tests that fails for most |
| 6 // services. By preventing creation of services, we reduce dependencies and | 6 // services. By preventing creation of services, we reduce dependencies and |
| 7 // keep the profile clean. Clients of this class must handle the NULL return | 7 // keep the profile clean. Clients of this class must handle the NULL return |
| 8 // value, however. | 8 // value, however. |
| 9 | 9 |
| 10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 98 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 99 virtual void StartAutoupdateTimer() OVERRIDE {} | 99 virtual void StartAutoupdateTimer() OVERRIDE {} |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 virtual ChromeNetLog* net_log() OVERRIDE; | 102 virtual ChromeNetLog* net_log() OVERRIDE; |
| 103 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; | 103 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; |
| 104 virtual ComponentUpdateService* component_updater() OVERRIDE; | 104 virtual ComponentUpdateService* component_updater() OVERRIDE; |
| 105 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; | 105 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; |
| 106 virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; | 106 virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; |
| 107 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; | 107 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; |
| 108 virtual chrome::StorageMonitor* storage_monitor() OVERRIDE; |
| 108 virtual chrome::MediaFileSystemRegistry* | 109 virtual chrome::MediaFileSystemRegistry* |
| 109 media_file_system_registry() OVERRIDE; | 110 media_file_system_registry() OVERRIDE; |
| 110 virtual bool created_local_state() const OVERRIDE; | 111 virtual bool created_local_state() const OVERRIDE; |
| 111 | 112 |
| 112 #if defined(ENABLE_WEBRTC) | 113 #if defined(ENABLE_WEBRTC) |
| 113 virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE; | 114 virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE; |
| 114 #endif | 115 #endif |
| 115 | 116 |
| 116 // Set the local state for tests. Consumer is responsible for cleaning it up | 117 // Set the local state for tests. Consumer is responsible for cleaning it up |
| 117 // afterwards (using ScopedTestingLocalState, for example). | 118 // afterwards (using ScopedTestingLocalState, for example). |
| 118 void SetLocalState(PrefService* local_state); | 119 void SetLocalState(PrefService* local_state); |
| 119 void SetProfileManager(ProfileManager* profile_manager); | 120 void SetProfileManager(ProfileManager* profile_manager); |
| 120 void SetIOThread(IOThread* io_thread); | 121 void SetIOThread(IOThread* io_thread); |
| 121 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); | 122 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); |
| 122 void SetSafeBrowsingService(SafeBrowsingService* sb_service); | 123 void SetSafeBrowsingService(SafeBrowsingService* sb_service); |
| 123 void SetBookmarkPromptController(BookmarkPromptController* controller); | 124 void SetBookmarkPromptController(BookmarkPromptController* controller); |
| 124 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); | 125 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); |
| 126 void SetStorageMonitor(chrome::StorageMonitor* storage_monitor); |
| 125 | 127 |
| 126 private: | 128 private: |
| 127 scoped_ptr<content::NotificationService> notification_service_; | 129 scoped_ptr<content::NotificationService> notification_service_; |
| 128 unsigned int module_ref_count_; | 130 unsigned int module_ref_count_; |
| 129 std::string app_locale_; | 131 std::string app_locale_; |
| 130 | 132 |
| 131 // TODO(ios): Add back members as more code is compiled. | 133 // TODO(ios): Add back members as more code is compiled. |
| 132 #if !defined(OS_IOS) | 134 #if !defined(OS_IOS) |
| 133 #if defined(ENABLE_CONFIGURATION_POLICY) | 135 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 134 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 136 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
| 135 #else | 137 #else |
| 136 scoped_ptr<policy::PolicyService> policy_service_; | 138 scoped_ptr<policy::PolicyService> policy_service_; |
| 137 #endif | 139 #endif |
| 138 scoped_ptr<ProfileManager> profile_manager_; | 140 scoped_ptr<ProfileManager> profile_manager_; |
| 139 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 141 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
| 140 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; | 142 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; |
| 141 scoped_refptr<printing::PrintPreviewDialogController> | 143 scoped_refptr<printing::PrintPreviewDialogController> |
| 142 print_preview_dialog_controller_; | 144 print_preview_dialog_controller_; |
| 143 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; | 145 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; |
| 144 scoped_ptr<RenderWidgetSnapshotTaker> render_widget_snapshot_taker_; | 146 scoped_ptr<RenderWidgetSnapshotTaker> render_widget_snapshot_taker_; |
| 145 scoped_refptr<SafeBrowsingService> sb_service_; | 147 scoped_refptr<SafeBrowsingService> sb_service_; |
| 146 scoped_ptr<BookmarkPromptController> bookmark_prompt_controller_; | 148 scoped_ptr<BookmarkPromptController> bookmark_prompt_controller_; |
| 147 #if !defined(OS_ANDROID) | 149 #endif // !defined(OS_IOS) |
| 150 |
| 151 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
| 152 scoped_ptr<chrome::StorageMonitor> storage_monitor_; |
| 148 scoped_ptr<chrome::MediaFileSystemRegistry> media_file_system_registry_; | 153 scoped_ptr<chrome::MediaFileSystemRegistry> media_file_system_registry_; |
| 149 #endif | 154 #endif |
| 150 #endif // !defined(OS_IOS) | |
| 151 | 155 |
| 152 // The following objects are not owned by TestingBrowserProcess: | 156 // The following objects are not owned by TestingBrowserProcess: |
| 153 PrefService* local_state_; | 157 PrefService* local_state_; |
| 154 IOThread* io_thread_; | 158 IOThread* io_thread_; |
| 155 net::URLRequestContextGetter* system_request_context_; | 159 net::URLRequestContextGetter* system_request_context_; |
| 156 | 160 |
| 157 scoped_ptr<BrowserProcessPlatformPart> platform_part_; | 161 scoped_ptr<BrowserProcessPlatformPart> platform_part_; |
| 158 | 162 |
| 159 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 163 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 160 }; | 164 }; |
| 161 | 165 |
| 162 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 166 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |