| 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(); |
| 64 virtual NotificationUIManager* notification_ui_manager(); | 72 virtual NotificationUIManager* notification_ui_manager(); |
| 65 virtual policy::ConfigurationPolicyProviderKeeper* | 73 virtual policy::ConfigurationPolicyProviderKeeper* |
| 66 configuration_policy_provider_keeper(); | 74 configuration_policy_provider_keeper(); |
| 67 virtual IconManager* icon_manager(); | 75 virtual IconManager* icon_manager(); |
| 68 virtual ThumbnailGenerator* GetThumbnailGenerator(); | 76 virtual ThumbnailGenerator* GetThumbnailGenerator(); |
| 69 virtual AutomationProviderList* InitAutomationProviderList(); | 77 virtual AutomationProviderList* InitAutomationProviderList(); |
| 70 virtual void InitDevToolsHttpProtocolHandler( | 78 virtual void InitDevToolsHttpProtocolHandler( |
| 71 const std::string& ip, | 79 const std::string& ip, |
| 72 int port, | 80 int port, |
| 73 const std::string& frontend_url); | 81 const std::string& frontend_url); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void CreateIconManager(); | 138 void CreateIconManager(); |
| 131 void CreateDevToolsManager(); | 139 void CreateDevToolsManager(); |
| 132 void CreateSidebarManager(); | 140 void CreateSidebarManager(); |
| 133 void CreateGoogleURLTracker(); | 141 void CreateGoogleURLTracker(); |
| 134 void CreateIntranetRedirectDetector(); | 142 void CreateIntranetRedirectDetector(); |
| 135 void CreateNotificationUIManager(); | 143 void CreateNotificationUIManager(); |
| 136 void CreateStatusTrayManager(); | 144 void CreateStatusTrayManager(); |
| 137 void CreateTabCloseableStateWatcher(); | 145 void CreateTabCloseableStateWatcher(); |
| 138 void CreatePrintPreviewTabController(); | 146 void CreatePrintPreviewTabController(); |
| 139 void CreateSafeBrowsingDetectionService(); | 147 void CreateSafeBrowsingDetectionService(); |
| 148 void CreatePrefProxyConfigTracker(); |
| 149 void CreateSystemRequestContextGetter(); |
| 140 | 150 |
| 141 bool IsSafeBrowsingDetectionServiceEnabled(); | 151 bool IsSafeBrowsingDetectionServiceEnabled(); |
| 142 | 152 |
| 143 #if defined(IPC_MESSAGE_LOG_ENABLED) | 153 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 144 void SetIPCLoggingEnabledForChildProcesses(bool enabled); | 154 void SetIPCLoggingEnabledForChildProcesses(bool enabled); |
| 145 #endif | 155 #endif |
| 146 | 156 |
| 147 bool created_resource_dispatcher_host_; | 157 bool created_resource_dispatcher_host_; |
| 148 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; | 158 scoped_ptr<ResourceDispatcherHost> resource_dispatcher_host_; |
| 149 | 159 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_; | 217 scoped_ptr<IntranetRedirectDetector> intranet_redirect_detector_; |
| 208 | 218 |
| 209 scoped_ptr<NotificationService> main_notification_service_; | 219 scoped_ptr<NotificationService> main_notification_service_; |
| 210 | 220 |
| 211 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_; | 221 scoped_ptr<TabCloseableStateWatcher> tab_closeable_state_watcher_; |
| 212 | 222 |
| 213 bool created_safe_browsing_detection_service_; | 223 bool created_safe_browsing_detection_service_; |
| 214 scoped_ptr<safe_browsing::ClientSideDetectionService> | 224 scoped_ptr<safe_browsing::ClientSideDetectionService> |
| 215 safe_browsing_detection_service_; | 225 safe_browsing_detection_service_; |
| 216 | 226 |
| 227 bool created_pref_proxy_config_tracker_; |
| 228 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
| 229 |
| 230 bool created_system_request_context_; |
| 231 scoped_refptr<URLRequestContextGetter> system_request_context_; |
| 232 |
| 217 unsigned int module_ref_count_; | 233 unsigned int module_ref_count_; |
| 218 bool did_start_; | 234 bool did_start_; |
| 219 | 235 |
| 220 // Ensures that all the print jobs are finished before closing the browser. | 236 // Ensures that all the print jobs are finished before closing the browser. |
| 221 scoped_ptr<printing::PrintJobManager> print_job_manager_; | 237 scoped_ptr<printing::PrintJobManager> print_job_manager_; |
| 222 | 238 |
| 223 std::string locale_; | 239 std::string locale_; |
| 224 | 240 |
| 225 bool checked_for_new_frames_; | 241 bool checked_for_new_frames_; |
| 226 bool using_new_frames_; | 242 bool using_new_frames_; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // restarted, and if that's the case, restarts the browser. | 276 // restarted, and if that's the case, restarts the browser. |
| 261 void OnAutoupdateTimer(); | 277 void OnAutoupdateTimer(); |
| 262 bool CanAutorestartForUpdate() const; | 278 bool CanAutorestartForUpdate() const; |
| 263 void RestartPersistentInstance(); | 279 void RestartPersistentInstance(); |
| 264 #endif // defined(OS_WIN) || defined(OS_LINUX) | 280 #endif // defined(OS_WIN) || defined(OS_LINUX) |
| 265 | 281 |
| 266 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); | 282 DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl); |
| 267 }; | 283 }; |
| 268 | 284 |
| 269 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ | 285 #endif // CHROME_BROWSER_BROWSER_PROCESS_IMPL_H_ |
| OLD | NEW |