| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class IOThread; | 22 class IOThread; |
| 23 class GoogleURLTracker; | 23 class GoogleURLTracker; |
| 24 class PrefService; | 24 class PrefService; |
| 25 | 25 |
| 26 namespace base { | 26 namespace base { |
| 27 class WaitableEvent; | 27 class WaitableEvent; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace policy { | 30 namespace policy { |
| 31 class ConfigurationPolicyProviderKeeper; | 31 class BrowserPolicyConnector; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace ui { | 34 namespace ui { |
| 35 class Clipboard; | 35 class Clipboard; |
| 36 } | 36 } |
| 37 | 37 |
| 38 class TestingBrowserProcess : public BrowserProcess { | 38 class TestingBrowserProcess : public BrowserProcess { |
| 39 public: | 39 public: |
| 40 TestingBrowserProcess(); | 40 TestingBrowserProcess(); |
| 41 virtual ~TestingBrowserProcess(); | 41 virtual ~TestingBrowserProcess(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 55 virtual base::Thread* file_thread(); | 55 virtual base::Thread* file_thread(); |
| 56 | 56 |
| 57 virtual base::Thread* db_thread(); | 57 virtual base::Thread* db_thread(); |
| 58 | 58 |
| 59 virtual base::Thread* cache_thread(); | 59 virtual base::Thread* cache_thread(); |
| 60 | 60 |
| 61 virtual ProfileManager* profile_manager(); | 61 virtual ProfileManager* profile_manager(); |
| 62 | 62 |
| 63 virtual PrefService* local_state(); | 63 virtual PrefService* local_state(); |
| 64 | 64 |
| 65 virtual policy::ConfigurationPolicyProviderKeeper* | 65 virtual policy::BrowserPolicyConnector* browser_policy_connector(); |
| 66 configuration_policy_provider_keeper(); | |
| 67 | 66 |
| 68 virtual IconManager* icon_manager(); | 67 virtual IconManager* icon_manager(); |
| 69 | 68 |
| 70 virtual ThumbnailGenerator* GetThumbnailGenerator(); | 69 virtual ThumbnailGenerator* GetThumbnailGenerator(); |
| 71 | 70 |
| 72 virtual DevToolsManager* devtools_manager(); | 71 virtual DevToolsManager* devtools_manager(); |
| 73 | 72 |
| 74 virtual SidebarManager* sidebar_manager(); | 73 virtual SidebarManager* sidebar_manager(); |
| 75 | 74 |
| 76 virtual TabCloseableStateWatcher* tab_closeable_state_watcher(); | 75 virtual TabCloseableStateWatcher* tab_closeable_state_watcher(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); | 129 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); |
| 131 | 130 |
| 132 private: | 131 private: |
| 133 NotificationService notification_service_; | 132 NotificationService notification_service_; |
| 134 scoped_ptr<base::WaitableEvent> shutdown_event_; | 133 scoped_ptr<base::WaitableEvent> shutdown_event_; |
| 135 unsigned int module_ref_count_; | 134 unsigned int module_ref_count_; |
| 136 scoped_ptr<ui::Clipboard> clipboard_; | 135 scoped_ptr<ui::Clipboard> clipboard_; |
| 137 std::string app_locale_; | 136 std::string app_locale_; |
| 138 | 137 |
| 139 PrefService* pref_service_; | 138 PrefService* pref_service_; |
| 140 bool created_configuration_policy_provider_keeper_; | 139 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
| 141 scoped_ptr<policy::ConfigurationPolicyProviderKeeper> | |
| 142 configuration_policy_provider_keeper_; | |
| 143 scoped_ptr<GoogleURLTracker> google_url_tracker_; | 140 scoped_ptr<GoogleURLTracker> google_url_tracker_; |
| 144 | 141 |
| 145 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 142 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
| 146 }; | 143 }; |
| 147 | 144 |
| 148 // Scoper to put a TestingBrowserProcess in |g_browser_process|. | 145 // Scoper to put a TestingBrowserProcess in |g_browser_process|. |
| 149 class ScopedTestingBrowserProcess { | 146 class ScopedTestingBrowserProcess { |
| 150 public: | 147 public: |
| 151 ScopedTestingBrowserProcess(); | 148 ScopedTestingBrowserProcess(); |
| 152 ~ScopedTestingBrowserProcess(); | 149 ~ScopedTestingBrowserProcess(); |
| 153 | 150 |
| 154 TestingBrowserProcess* get() { | 151 TestingBrowserProcess* get() { |
| 155 return browser_process_.get(); | 152 return browser_process_.get(); |
| 156 } | 153 } |
| 157 | 154 |
| 158 private: | 155 private: |
| 159 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 156 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
| 160 // After the transition is over, we should just stack-allocate it. | 157 // After the transition is over, we should just stack-allocate it. |
| 161 scoped_ptr<TestingBrowserProcess> browser_process_; | 158 scoped_ptr<TestingBrowserProcess> browser_process_; |
| 162 | 159 |
| 163 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); | 160 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); |
| 164 }; | 161 }; |
| 165 | 162 |
| 166 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 163 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |