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 // When each service is created, we set a flag indicating this. At this point, | 5 // When each service is created, we set a flag indicating this. At this point, |
6 // the service initialization could fail or succeed. This allows us to remember | 6 // the service initialization could fail or succeed. This allows us to remember |
7 // if we tried to create a service, and not try creating it over and over if | 7 // if we tried to create a service, and not try creating it over and over if |
8 // the creation failed. | 8 // the creation failed. |
9 | 9 |
10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 10 #ifndef CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
11 #define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 11 #define CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
12 #pragma once | 12 #pragma once |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
19 #include "base/timer.h" | 19 #include "base/timer.h" |
20 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/download/download_status_updater.h" | 22 #include "chrome/browser/download/download_status_updater.h" |
| 23 #include "chrome/browser/net/pref_proxy_config_service.h" |
23 #include "chrome/browser/prefs/pref_change_registrar.h" | 24 #include "chrome/browser/prefs/pref_change_registrar.h" |
24 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 25 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
25 #include "chrome/common/notification_observer.h" | 26 #include "chrome/common/notification_observer.h" |
26 #include "chrome/common/notification_registrar.h" | 27 #include "chrome/common/notification_registrar.h" |
27 #include "ipc/ipc_message.h" | 28 #include "ipc/ipc_message.h" |
28 | 29 |
29 class ChromeNetLog; | 30 class ChromeNetLog; |
30 class CommandLine; | 31 class CommandLine; |
31 class DevToolsHttpProtocolHandler; | 32 class DevToolsHttpProtocolHandler; |
32 class DevToolsProtocolHandler; | 33 class DevToolsProtocolHandler; |
33 class FilePath; | 34 class FilePath; |
34 class NotificationService; | 35 class NotificationService; |
35 class PluginDataRemover; | 36 class PluginDataRemover; |
| 37 class PrefProxyConfigTracker; |
36 class TabCloseableStateWatcher; | 38 class TabCloseableStateWatcher; |
37 | 39 |
| 40 namespace net { |
| 41 class ProxyConfigService; |
| 42 } // namespace net |
| 43 |
38 // Real implementation of BrowserProcess that creates and returns the services. | 44 // Real implementation of BrowserProcess that creates and returns the services. |
39 class BrowserProcessImpl : public BrowserProcess, | 45 class BrowserProcessImpl : public BrowserProcess, |
40 public base::NonThreadSafe, | 46 public base::NonThreadSafe, |
41 public NotificationObserver { | 47 public NotificationObserver { |
42 public: | 48 public: |
43 explicit BrowserProcessImpl(const CommandLine& command_line); | 49 explicit BrowserProcessImpl(const CommandLine& command_line); |
44 virtual ~BrowserProcessImpl(); | 50 virtual ~BrowserProcessImpl(); |
45 | 51 |
46 virtual void EndSession(); | 52 virtual void EndSession(); |
47 | 53 |
48 // BrowserProcess methods | 54 // BrowserProcess methods |
49 virtual ResourceDispatcherHost* resource_dispatcher_host(); | 55 virtual ResourceDispatcherHost* resource_dispatcher_host(); |
50 virtual MetricsService* metrics_service(); | 56 virtual MetricsService* metrics_service(); |
51 virtual IOThread* io_thread(); | 57 virtual IOThread* io_thread(); |
52 virtual base::Thread* file_thread(); | 58 virtual base::Thread* file_thread(); |
53 virtual base::Thread* db_thread(); | 59 virtual base::Thread* db_thread(); |
54 virtual base::Thread* process_launcher_thread(); | 60 virtual base::Thread* process_launcher_thread(); |
55 virtual base::Thread* cache_thread(); | 61 virtual base::Thread* cache_thread(); |
56 #if defined(USE_X11) | 62 #if defined(USE_X11) |
57 virtual base::Thread* background_x11_thread(); | 63 virtual base::Thread* background_x11_thread(); |
58 #endif | 64 #endif |
59 virtual ProfileManager* profile_manager(); | 65 virtual ProfileManager* profile_manager(); |
60 virtual PrefService* local_state(); | 66 virtual PrefService* local_state(); |
61 virtual DevToolsManager* devtools_manager(); | 67 virtual DevToolsManager* devtools_manager(); |
62 virtual SidebarManager* sidebar_manager(); | 68 virtual SidebarManager* sidebar_manager(); |
63 virtual ui::Clipboard* clipboard(); | 69 virtual ui::Clipboard* clipboard(); |
| 70 virtual PrefProxyConfigTracker* pref_proxy_config_tracker(); |
| 71 virtual scoped_refptr<URLRequestContextGetter> system_request_context(); |
| 72 #if defined(OS_CHROMEOS) |
| 73 virtual chromeos::ProxyConfigServiceImpl* |
| 74 chromeos_proxy_config_service_impl(); |
| 75 #endif // defined(OS_CHROMEOS) |
64 virtual NotificationUIManager* notification_ui_manager(); | 76 virtual NotificationUIManager* notification_ui_manager(); |
65 virtual policy::ConfigurationPolicyProviderKeeper* | 77 virtual policy::ConfigurationPolicyProviderKeeper* |
66 configuration_policy_provider_keeper(); | 78 configuration_policy_provider_keeper(); |
67 virtual IconManager* icon_manager(); | 79 virtual IconManager* icon_manager(); |
68 virtual ThumbnailGenerator* GetThumbnailGenerator(); | 80 virtual ThumbnailGenerator* GetThumbnailGenerator(); |
69 virtual AutomationProviderList* InitAutomationProviderList(); | 81 virtual AutomationProviderList* InitAutomationProviderList(); |
70 virtual void InitDevToolsHttpProtocolHandler( | 82 virtual void InitDevToolsHttpProtocolHandler( |
71 const std::string& ip, | 83 const std::string& ip, |
72 int port, | 84 int port, |
73 const std::string& frontend_url); | 85 const std::string& frontend_url); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void CreateIconManager(); | 142 void CreateIconManager(); |
131 void CreateDevToolsManager(); | 143 void CreateDevToolsManager(); |
132 void CreateSidebarManager(); | 144 void CreateSidebarManager(); |
133 void CreateGoogleURLTracker(); | 145 void CreateGoogleURLTracker(); |
134 void CreateIntranetRedirectDetector(); | 146 void CreateIntranetRedirectDetector(); |
135 void CreateNotificationUIManager(); | 147 void CreateNotificationUIManager(); |
136 void CreateStatusTrayManager(); | 148 void CreateStatusTrayManager(); |
137 void CreateTabCloseableStateWatcher(); | 149 void CreateTabCloseableStateWatcher(); |
138 void CreatePrintPreviewTabController(); | 150 void CreatePrintPreviewTabController(); |
139 void CreateSafeBrowsingDetectionService(); | 151 void CreateSafeBrowsingDetectionService(); |
| 152 void CreatePrefProxyConfigTracker(); |
| 153 void CreateSystemRequestContextGetter(); |
140 | 154 |
141 bool IsSafeBrowsingDetectionServiceEnabled(); | 155 bool IsSafeBrowsingDetectionServiceEnabled(); |
142 | 156 |
143 #if defined(IPC_MESSAGE_LOG_ENABLED) | 157 #if defined(IPC_MESSAGE_LOG_ENABLED) |
144 void SetIPCLoggingEnabledForChildProcesses(bool enabled); | 158 void SetIPCLoggingEnabledForChildProcesses(bool enabled); |
145 #endif | 159 #endif |
146 | 160 |
147 bool created_resource_dispatcher_host_; | 161 bool created_resource_dispatcher_host_; |
148 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; | 162 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; |
149 | 163 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_; | 221 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_; |
208 | 222 |
209 scoped_ptr<NotificationService> main_notification_service_; | 223 scoped_ptr<NotificationService> main_notification_service_; |
210 | 224 |
211 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_; | 225 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_; |
212 | 226 |
213 bool created_safe_browsing_detection_service_; | 227 bool created_safe_browsing_detection_service_; |
214 scoped_ptr<safe_browsing::ClientSideDetectionService> | 228 scoped_ptr<safe_browsing::ClientSideDetectionService> |
215 safe_browsing_detection_service_; | 229 safe_browsing_detection_service_; |
216 | 230 |
| 231 bool created_pref_proxy_config_tracker_; |
| 232 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
| 233 |
| 234 bool created_system_request_context_; |
| 235 |
217 unsigned int module_ref_count_; | 236 unsigned int module_ref_count_; |
218 bool did_start_; | 237 bool did_start_; |
219 | 238 |
220 // Ensures that all the print jobs are finished before closing the browser. | 239 // Ensures that all the print jobs are finished before closing the browser. |
221 scoped_ptr<printing::PrintJobManager> print_job_manager_; | 240 scoped_ptr<printing::PrintJobManager> print_job_manager_; |
222 | 241 |
223 std::string locale_; | 242 std::string locale_; |
224 | 243 |
225 bool checked_for_new_frames_; | 244 bool checked_for_new_frames_; |
226 bool using_new_frames_; | 245 bool using_new_frames_; |
(...skipping 29 matching lines...) Expand all Loading... |
256 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 275 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
257 base::RepeatingTimer<BrowserProcessImpl> autoupdate_timer_; | 276 base::RepeatingTimer<BrowserProcessImpl> autoupdate_timer_; |
258 | 277 |
259 // Gets called by autoupdate timer to see if browser needs restart and can be | 278 // Gets called by autoupdate timer to see if browser needs restart and can be |
260 // restarted, and if that's the case, restarts the browser. | 279 // restarted, and if that's the case, restarts the browser. |
261 void OnAutoupdateTimer(); | 280 void OnAutoupdateTimer(); |
262 bool CanAutorestartForUpdate() const; | 281 bool CanAutorestartForUpdate() const; |
263 void RestartPersistentInstance(); | 282 void RestartPersistentInstance(); |
264 #endif // defined(OS_WIN) || defined(OS_LINUX) | 283 #endif // defined(OS_WIN) || defined(OS_LINUX) |
265 | 284 |
| 285 #if defined(OS_CHROMEOS) |
| 286 scoped_refptr<chromeos::ProxyConfigServiceImpl> |
| 287 chromeos_proxy_config_service_impl_; |
| 288 #endif |
| 289 |
266 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 290 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
267 }; | 291 }; |
268 | 292 |
269 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 293 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
OLD | NEW |