| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TESTING_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| 11 #define CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 11 #define CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| 12 #pragma once | 12 #pragma once |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "content/common/notification_service.h" | 19 #include "content/common/notification_service.h" |
| 20 | 20 |
| 21 class BackgroundModeManager; |
| 21 class IOThread; | 22 class IOThread; |
| 22 class GoogleURLTracker; | 23 class GoogleURLTracker; |
| 23 class NotificationUIManager; | 24 class NotificationUIManager; |
| 24 class PrefService; | 25 class PrefService; |
| 25 class WatchDogThread; | 26 class WatchDogThread; |
| 26 | 27 |
| 27 namespace base { | 28 namespace base { |
| 28 class WaitableEvent; | 29 class WaitableEvent; |
| 29 } | 30 } |
| 30 | 31 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 virtual IconManager* icon_manager(); | 77 virtual IconManager* icon_manager(); |
| 77 | 78 |
| 78 virtual ThumbnailGenerator* GetThumbnailGenerator(); | 79 virtual ThumbnailGenerator* GetThumbnailGenerator(); |
| 79 | 80 |
| 80 virtual DevToolsManager* devtools_manager(); | 81 virtual DevToolsManager* devtools_manager(); |
| 81 | 82 |
| 82 virtual SidebarManager* sidebar_manager(); | 83 virtual SidebarManager* sidebar_manager(); |
| 83 | 84 |
| 84 virtual TabCloseableStateWatcher* tab_closeable_state_watcher(); | 85 virtual TabCloseableStateWatcher* tab_closeable_state_watcher(); |
| 85 | 86 |
| 87 virtual BackgroundModeManager* background_mode_manager(); |
| 88 |
| 89 virtual StatusTray* status_tray(); |
| 90 |
| 86 virtual safe_browsing::ClientSideDetectionService* | 91 virtual safe_browsing::ClientSideDetectionService* |
| 87 safe_browsing_detection_service(); | 92 safe_browsing_detection_service(); |
| 88 | 93 |
| 89 virtual net::URLRequestContextGetter* system_request_context(); | 94 virtual net::URLRequestContextGetter* system_request_context(); |
| 90 | 95 |
| 91 #if defined(OS_CHROMEOS) | 96 #if defined(OS_CHROMEOS) |
| 92 virtual chromeos::ProxyConfigServiceImpl* | 97 virtual chromeos::ProxyConfigServiceImpl* |
| 93 chromeos_proxy_config_service_impl(); | 98 chromeos_proxy_config_service_impl(); |
| 94 #endif // defined(OS_CHROMEOS) | 99 #endif // defined(OS_CHROMEOS) |
| 95 | 100 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 scoped_ptr<ui::Clipboard> clipboard_; | 163 scoped_ptr<ui::Clipboard> clipboard_; |
| 159 std::string app_locale_; | 164 std::string app_locale_; |
| 160 | 165 |
| 161 // Weak pointer. | 166 // Weak pointer. |
| 162 PrefService* local_state_; | 167 PrefService* local_state_; |
| 163 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 168 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
| 164 scoped_ptr<GoogleURLTracker> google_url_tracker_; | 169 scoped_ptr<GoogleURLTracker> google_url_tracker_; |
| 165 scoped_ptr<ProfileManager> profile_manager_; | 170 scoped_ptr<ProfileManager> profile_manager_; |
| 166 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 171 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
| 167 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; | 172 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; |
| 173 scoped_ptr<BackgroundModeManager> background_mode_manager_; |
| 168 | 174 |
| 169 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 175 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 170 }; | 176 }; |
| 171 | 177 |
| 172 // Scoper to put a TestingBrowserProcess in |g_browser_process|. | 178 // Scoper to put a TestingBrowserProcess in |g_browser_process|. |
| 173 class ScopedTestingBrowserProcess { | 179 class ScopedTestingBrowserProcess { |
| 174 public: | 180 public: |
| 175 ScopedTestingBrowserProcess(); | 181 ScopedTestingBrowserProcess(); |
| 176 ~ScopedTestingBrowserProcess(); | 182 ~ScopedTestingBrowserProcess(); |
| 177 | 183 |
| 178 TestingBrowserProcess* get() { | 184 TestingBrowserProcess* get() { |
| 179 return browser_process_.get(); | 185 return browser_process_.get(); |
| 180 } | 186 } |
| 181 | 187 |
| 182 private: | 188 private: |
| 183 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 189 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
| 184 // After the transition is over, we should just stack-allocate it. | 190 // After the transition is over, we should just stack-allocate it. |
| 185 scoped_ptr<TestingBrowserProcess> browser_process_; | 191 scoped_ptr<TestingBrowserProcess> browser_process_; |
| 186 | 192 |
| 187 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); | 193 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); |
| 188 }; | 194 }; |
| 189 | 195 |
| 190 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 196 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |