| 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_ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 virtual DevToolsManager* devtools_manager(); | 72 virtual DevToolsManager* devtools_manager(); |
| 73 | 73 |
| 74 virtual SidebarManager* sidebar_manager(); | 74 virtual SidebarManager* sidebar_manager(); |
| 75 | 75 |
| 76 virtual TabCloseableStateWatcher* tab_closeable_state_watcher(); | 76 virtual TabCloseableStateWatcher* tab_closeable_state_watcher(); |
| 77 | 77 |
| 78 virtual safe_browsing::ClientSideDetectionService* | 78 virtual safe_browsing::ClientSideDetectionService* |
| 79 safe_browsing_detection_service(); | 79 safe_browsing_detection_service(); |
| 80 | 80 |
| 81 virtual PrefProxyConfigTracker* pref_proxy_config_tracker(); |
| 82 |
| 83 virtual scoped_refptr<URLRequestContextGetter> system_request_context(); |
| 84 |
| 81 virtual ui::Clipboard* clipboard(); | 85 virtual ui::Clipboard* clipboard(); |
| 82 | 86 |
| 83 virtual NotificationUIManager* notification_ui_manager(); | 87 virtual NotificationUIManager* notification_ui_manager(); |
| 84 | 88 |
| 85 virtual GoogleURLTracker* google_url_tracker(); | 89 virtual GoogleURLTracker* google_url_tracker(); |
| 86 | 90 |
| 87 virtual IntranetRedirectDetector* intranet_redirect_detector(); | 91 virtual IntranetRedirectDetector* intranet_redirect_detector(); |
| 88 | 92 |
| 89 virtual AutomationProviderList* InitAutomationProviderList(); | 93 virtual AutomationProviderList* InitAutomationProviderList(); |
| 90 | 94 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 #endif | 131 #endif |
| 128 | 132 |
| 129 void SetPrefService(PrefService* pref_service); | 133 void SetPrefService(PrefService* pref_service); |
| 130 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); | 134 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); |
| 131 | 135 |
| 132 private: | 136 private: |
| 133 NotificationService notification_service_; | 137 NotificationService notification_service_; |
| 134 scoped_ptr<base::WaitableEvent> shutdown_event_; | 138 scoped_ptr<base::WaitableEvent> shutdown_event_; |
| 135 unsigned int module_ref_count_; | 139 unsigned int module_ref_count_; |
| 136 scoped_ptr<ui::Clipboard> clipboard_; | 140 scoped_ptr<ui::Clipboard> clipboard_; |
| 141 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
| 137 std::string app_locale_; | 142 std::string app_locale_; |
| 138 | 143 |
| 139 PrefService* pref_service_; | 144 PrefService* pref_service_; |
| 140 bool created_configuration_policy_provider_keeper_; | 145 bool created_configuration_policy_provider_keeper_; |
| 141 scoped_ptr<policy::ConfigurationPolicyProviderKeeper> | 146 scoped_ptr<policy::ConfigurationPolicyProviderKeeper> |
| 142 configuration_policy_provider_keeper_; | 147 configuration_policy_provider_keeper_; |
| 143 scoped_ptr<GoogleURLTracker> google_url_tracker_; | 148 scoped_ptr<GoogleURLTracker> google_url_tracker_; |
| 144 | 149 |
| 145 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 150 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 146 }; | 151 }; |
| 147 | 152 |
| 148 // Scoper to put a TestingBrowserProcess in |g_browser_process|. | 153 // Scoper to put a TestingBrowserProcess in |g_browser_process|. |
| 149 class ScopedTestingBrowserProcess { | 154 class ScopedTestingBrowserProcess { |
| 150 public: | 155 public: |
| 151 ScopedTestingBrowserProcess(); | 156 ScopedTestingBrowserProcess(); |
| 152 ~ScopedTestingBrowserProcess(); | 157 ~ScopedTestingBrowserProcess(); |
| 153 | 158 |
| 154 private: | 159 private: |
| 155 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 160 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
| 156 // After the transition is over, we should just stack-allocate it. | 161 // After the transition is over, we should just stack-allocate it. |
| 157 scoped_ptr<TestingBrowserProcess> browser_process_; | 162 scoped_ptr<TestingBrowserProcess> browser_process_; |
| 158 | 163 |
| 159 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); | 164 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); |
| 160 }; | 165 }; |
| 161 | 166 |
| 162 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 167 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |