| 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 "build/build_config.h" | |
| 15 | |
| 16 #include <string> | 14 #include <string> |
| 17 | 15 |
| 18 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "build/build_config.h" |
| 19 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 20 #include "content/common/notification_service.h" | 19 #include "content/common/notification_service.h" |
| 21 | 20 |
| 22 class IOThread; | 21 class IOThread; |
| 23 class GoogleURLTracker; | 22 class GoogleURLTracker; |
| 24 class NotificationUIManager; | 23 class NotificationUIManager; |
| 25 class PrefService; | 24 class PrefService; |
| 26 class WatchDogThread; | 25 class WatchDogThread; |
| 27 | 26 |
| 28 namespace base { | 27 namespace base { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 110 |
| 112 virtual unsigned int AddRefModule(); | 111 virtual unsigned int AddRefModule(); |
| 113 virtual unsigned int ReleaseModule(); | 112 virtual unsigned int ReleaseModule(); |
| 114 | 113 |
| 115 virtual bool IsShuttingDown(); | 114 virtual bool IsShuttingDown(); |
| 116 | 115 |
| 117 virtual printing::PrintJobManager* print_job_manager(); | 116 virtual printing::PrintJobManager* print_job_manager(); |
| 118 | 117 |
| 119 virtual printing::PrintPreviewTabController* print_preview_tab_controller(); | 118 virtual printing::PrintPreviewTabController* print_preview_tab_controller(); |
| 120 | 119 |
| 120 virtual printing::BackgroundPrintingManager* background_printing_manager(); |
| 121 |
| 121 virtual const std::string& GetApplicationLocale(); | 122 virtual const std::string& GetApplicationLocale(); |
| 122 | 123 |
| 123 virtual void SetApplicationLocale(const std::string& app_locale); | 124 virtual void SetApplicationLocale(const std::string& app_locale); |
| 124 | 125 |
| 125 virtual DownloadStatusUpdater* download_status_updater(); | 126 virtual DownloadStatusUpdater* download_status_updater(); |
| 126 | 127 |
| 127 virtual base::WaitableEvent* shutdown_event(); | 128 virtual base::WaitableEvent* shutdown_event(); |
| 128 | 129 |
| 129 virtual bool plugin_finder_disabled() const; | 130 virtual bool plugin_finder_disabled() const; |
| 130 | 131 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 152 unsigned int module_ref_count_; | 153 unsigned int module_ref_count_; |
| 153 scoped_ptr<ui::Clipboard> clipboard_; | 154 scoped_ptr<ui::Clipboard> clipboard_; |
| 154 std::string app_locale_; | 155 std::string app_locale_; |
| 155 | 156 |
| 156 // Weak pointer. | 157 // Weak pointer. |
| 157 PrefService* local_state_; | 158 PrefService* local_state_; |
| 158 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 159 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
| 159 scoped_ptr<GoogleURLTracker> google_url_tracker_; | 160 scoped_ptr<GoogleURLTracker> google_url_tracker_; |
| 160 scoped_ptr<ProfileManager> profile_manager_; | 161 scoped_ptr<ProfileManager> profile_manager_; |
| 161 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 162 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
| 163 scoped_refptr<printing::BackgroundPrintingManager> |
| 164 background_printing_manager_; |
| 162 | 165 |
| 163 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 166 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 164 }; | 167 }; |
| 165 | 168 |
| 166 // Scoper to put a TestingBrowserProcess in |g_browser_process|. | 169 // Scoper to put a TestingBrowserProcess in |g_browser_process|. |
| 167 class ScopedTestingBrowserProcess { | 170 class ScopedTestingBrowserProcess { |
| 168 public: | 171 public: |
| 169 ScopedTestingBrowserProcess(); | 172 ScopedTestingBrowserProcess(); |
| 170 ~ScopedTestingBrowserProcess(); | 173 ~ScopedTestingBrowserProcess(); |
| 171 | 174 |
| 172 TestingBrowserProcess* get() { | 175 TestingBrowserProcess* get() { |
| 173 return browser_process_.get(); | 176 return browser_process_.get(); |
| 174 } | 177 } |
| 175 | 178 |
| 176 private: | 179 private: |
| 177 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 180 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
| 178 // After the transition is over, we should just stack-allocate it. | 181 // After the transition is over, we should just stack-allocate it. |
| 179 scoped_ptr<TestingBrowserProcess> browser_process_; | 182 scoped_ptr<TestingBrowserProcess> browser_process_; |
| 180 | 183 |
| 181 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); | 184 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); |
| 182 }; | 185 }; |
| 183 | 186 |
| 184 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 187 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |