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 BackgroundModeManager; |
22 class IOThread; | 22 class IOThread; |
23 class GoogleURLTracker; | 23 class GoogleURLTracker; |
| 24 class MHTMLGenerationManager; |
24 class NotificationUIManager; | 25 class NotificationUIManager; |
25 class PrefService; | 26 class PrefService; |
26 class WatchDogThread; | 27 class WatchDogThread; |
27 | 28 |
28 namespace base { | 29 namespace base { |
29 class WaitableEvent; | 30 class WaitableEvent; |
30 } | 31 } |
31 | 32 |
32 namespace policy { | 33 namespace policy { |
33 class BrowserPolicyConnector; | 34 class BrowserPolicyConnector; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 107 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
107 virtual void StartAutoupdateTimer() {} | 108 virtual void StartAutoupdateTimer() {} |
108 #endif | 109 #endif |
109 | 110 |
110 virtual ChromeNetLog* net_log(); | 111 virtual ChromeNetLog* net_log(); |
111 virtual prerender::PrerenderTracker* prerender_tracker(); | 112 virtual prerender::PrerenderTracker* prerender_tracker(); |
112 | 113 |
113 #if defined(IPC_MESSAGE_LOG_ENABLED) | 114 #if defined(IPC_MESSAGE_LOG_ENABLED) |
114 virtual void SetIPCLoggingEnabled(bool enable) {} | 115 virtual void SetIPCLoggingEnabled(bool enable) {} |
115 #endif | 116 #endif |
| 117 virtual MHTMLGenerationManager* mhtml_generation_manager(); |
116 | 118 |
117 // Set the local state for tests. Consumer is responsible for cleaning it up | 119 // Set the local state for tests. Consumer is responsible for cleaning it up |
118 // afterwards (using ScopedTestingLocalState, for example). | 120 // afterwards (using ScopedTestingLocalState, for example). |
119 void SetLocalState(PrefService* local_state); | 121 void SetLocalState(PrefService* local_state); |
120 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); | 122 void SetGoogleURLTracker(GoogleURLTracker* google_url_tracker); |
121 void SetProfileManager(ProfileManager* profile_manager); | 123 void SetProfileManager(ProfileManager* profile_manager); |
122 | 124 |
123 private: | 125 private: |
124 NotificationService notification_service_; | 126 NotificationService notification_service_; |
125 unsigned int module_ref_count_; | 127 unsigned int module_ref_count_; |
(...skipping 24 matching lines...) Expand all Loading... |
150 | 152 |
151 private: | 153 private: |
152 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. | 154 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
153 // After the transition is over, we should just stack-allocate it. | 155 // After the transition is over, we should just stack-allocate it. |
154 scoped_ptr<TestingBrowserProcess> browser_process_; | 156 scoped_ptr<TestingBrowserProcess> browser_process_; |
155 | 157 |
156 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); | 158 DISALLOW_COPY_AND_ASSIGN(ScopedTestingBrowserProcess); |
157 }; | 159 }; |
158 | 160 |
159 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ | 161 #endif // CHROME_TEST_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |