| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 virtual MHTMLGenerationManager* mhtml_generation_manager(); | 118 virtual MHTMLGenerationManager* mhtml_generation_manager(); |
| 119 virtual GpuBlacklistUpdater* gpu_blacklist_updater(); | 119 virtual GpuBlacklistUpdater* gpu_blacklist_updater(); |
| 120 virtual ComponentUpdateService* component_updater(); | 120 virtual ComponentUpdateService* component_updater(); |
| 121 | 121 |
| 122 // Set the local state for tests. Consumer is responsible for cleaning it up | 122 // Set the local state for tests. Consumer is responsible for cleaning it up |
| 123 // afterwards (using ScopedTestingLocalState, for example). | 123 // afterwards (using ScopedTestingLocalState, for example). |
| 124 void SetLocalState(PrefService* local_state); | 124 void SetLocalState(PrefService* local_state); |
| 125 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); | 125 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); |
| 126 void SetProfileManager(ProfileManager* profile_manager); | 126 void SetProfileManager(ProfileManager* profile_manager); |
| 127 void SetIOThread(IOThread* io_thread); | 127 void SetIOThread(IOThread* io_thread); |
| 128 void SetDevToolsManager(DevToolsManager*); |
| 128 | 129 |
| 129 private: | 130 private: |
| 130 NotificationService notification_service_; | 131 NotificationService notification_service_; |
| 131 unsigned int module_ref_count_; | 132 unsigned int module_ref_count_; |
| 132 scoped_ptr<ui::Clipboard> clipboard_; | 133 scoped_ptr<ui::Clipboard> clipboard_; |
| 133 std::string app_locale_; | 134 std::string app_locale_; |
| 134 | 135 |
| 135 // Weak pointer. | 136 // Weak pointer. |
| 136 PrefService* local_state_; | 137 PrefService* local_state_; |
| 137 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 138 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
| 138 scoped_ptr<GoogleURLTracker> google_url_tracker_; | 139 scoped_ptr<GoogleURLTracker> google_url_tracker_; |
| 139 scoped_ptr<ProfileManager> profile_manager_; | 140 scoped_ptr<ProfileManager> profile_manager_; |
| 140 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 141 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
| 141 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; | 142 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; |
| 142 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; | 143 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; |
| 143 IOThread* io_thread_; | 144 IOThread* io_thread_; |
| 145 scoped_ptr<DevToolsManager> devtools_manager_; |
| 144 | 146 |
| 145 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 147 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 146 }; | 148 }; |
| 147 | 149 |
| 148 // Scoper to put a TestingBrowserProcess in |g_browser_process|. | 150 // Scoper to put a TestingBrowserProcess in |g_browser_process|. |
| 149 class ScopedTestingBrowserProcess { | 151 class ScopedTestingBrowserProcess { |
| 150 public: | 152 public: |
| 151 ScopedTestingBrowserProcess(); | 153 ScopedTestingBrowserProcess(); |
| 152 ~ScopedTestingBrowserProcess(); | 154 ~ScopedTestingBrowserProcess(); |
| 153 | 155 |
| 154 TestingBrowserProcess* get() { | 156 TestingBrowserProcess* get() { |
| 155 return browser_process_.get(); | 157 return browser_process_.get(); |
| 156 } | 158 } |
| 157 | 159 |
| 158 private: | 160 private: |
| 159 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 161 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
| 160 // After the transition is over, we should just stack-allocate it. | 162 // After the transition is over, we should just stack-allocate it. |
| 161 scoped_ptr<TestingBrowserProcess> browser_process_; | 163 scoped_ptr<TestingBrowserProcess> browser_process_; |
| 162 | 164 |
| 163 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); | 165 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); |
| 164 }; | 166 }; |
| 165 | 167 |
| 166 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 168 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |