blob: 6267f806fb59a6073010fd4ca5d3b29294136787 [file] [log] [blame]
[email protected]3a80ea332012-01-09 19:53:291// Copyright (c) 2012 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
[email protected]88264c92009-10-01 17:17:365// This interface is for managing the global services of the application. Each
initial.commit09911bf2008-07-26 23:55:296// service is lazily created when requested the first time. The service getters
7// will return NULL if the service is not available, so callers must check for
8// this condition.
9
[email protected]bfd04a62009-02-01 18:16:5610#ifndef CHROME_BROWSER_BROWSER_PROCESS_H_
11#define CHROME_BROWSER_BROWSER_PROCESS_H_
initial.commit09911bf2008-07-26 23:55:2912
13#include <string>
14
15#include "base/basictypes.h"
initial.commit09911bf2008-07-26 23:55:2916
17class AutomationProviderList;
[email protected]9e7f015f2011-05-28 00:24:2518class BackgroundModeManager;
[email protected]d6f37fc2011-02-13 23:58:4119class ChromeNetLog;
[email protected]ca167a32011-09-30 15:19:1120class CRLSetFetcher;
[email protected]c1adf5a2011-08-03 22:11:3721class ComponentUpdateService;
[email protected]41291322010-07-15 17:09:0122class DownloadRequestLimiter;
[email protected]073ed7b2010-09-27 09:20:0223class DownloadStatusUpdater;
initial.commit09911bf2008-07-26 23:55:2924class IconManager;
[email protected]d99bcaa2010-12-05 20:15:5625class IntranetRedirectDetector;
26class IOThread;
initial.commit09911bf2008-07-26 23:55:2927class MetricsService;
[email protected]29672ab2009-10-30 03:44:0328class NotificationUIManager;
initial.commit09911bf2008-07-26 23:55:2929class PrefService;
[email protected]4475d232011-07-27 15:29:2030class Profile;
initial.commit09911bf2008-07-26 23:55:2931class ProfileManager;
[email protected]94e385322012-10-08 20:21:3332class RenderWidgetSnapshotTaker;
[email protected]462a0ff2011-06-02 17:15:3433class SafeBrowsingService;
[email protected]9e7f015f2011-05-28 00:24:2534class StatusTray;
[email protected]0b565182011-03-02 18:11:1535class WatchDogThread;
initial.commit09911bf2008-07-26 23:55:2936
[email protected]db0e86dd2011-03-16 14:47:2137#if defined(OS_CHROMEOS)
[email protected]38489a32012-05-11 02:24:5438namespace chromeos {
[email protected]5b869962011-09-20 19:49:3339class OomPriorityManager;
40}
[email protected]db0e86dd2011-03-16 14:47:2141#endif // defined(OS_CHROMEOS)
42
[email protected]04811242012-07-06 18:04:2943namespace chrome_variations {
44class VariationsService;
45}
46
[email protected]5a38dfd2012-07-23 23:22:1047namespace extensions {
48class EventRouterForwarder;
49}
50
[email protected]abe2c032011-03-31 18:49:3451namespace net {
52class URLRequestContextGetter;
53}
54
[email protected]80745e32012-05-08 01:22:1255namespace policy {
56class BrowserPolicyConnector;
57class PolicyService;
58}
59
[email protected]1459fb62011-05-25 19:03:2760namespace prerender {
61class PrerenderTracker;
62}
63
initial.commit09911bf2008-07-26 23:55:2964namespace printing {
[email protected]68f88b992011-05-07 02:01:3965class BackgroundPrintingManager;
initial.commit09911bf2008-07-26 23:55:2966class PrintJobManager;
[email protected]dbeebd52010-11-16 20:34:1667class PrintPreviewTabController;
initial.commit09911bf2008-07-26 23:55:2968}
69
[email protected]462a0ff2011-06-02 17:15:3470namespace safe_browsing {
71class ClientSideDetectionService;
72}
73
initial.commit09911bf2008-07-26 23:55:2974// NOT THREAD SAFE, call only from the main thread.
75// These functions shouldn't return NULL unless otherwise noted.
76class BrowserProcess {
77 public:
[email protected]1889dc1b2010-10-14 22:03:1378 BrowserProcess();
79 virtual ~BrowserProcess();
initial.commit09911bf2008-07-26 23:55:2980
[email protected]99907362012-01-11 05:41:4081 // Called when the ResourceDispatcherHost object is created by content.
82 virtual void ResourceDispatcherHostCreated() = 0;
83
initial.commit09911bf2008-07-26 23:55:2984 // Invoked when the user is logging out/shutting down. When logging off we may
85 // not have enough time to do a normal shutdown. This method is invoked prior
86 // to normal shutdown and saves any state that must be saved before we are
87 // continue shutdown.
88 virtual void EndSession() = 0;
89
90 // Services: any of these getters may return NULL
initial.commit09911bf2008-07-26 23:55:2991 virtual MetricsService* metrics_service() = 0;
92 virtual ProfileManager* profile_manager() = 0;
93 virtual PrefService* local_state() = 0;
[email protected]abe2c032011-03-31 18:49:3494 virtual net::URLRequestContextGetter* system_request_context() = 0;
[email protected]04811242012-07-06 18:04:2995 virtual chrome_variations::VariationsService* variations_service() = 0;
[email protected]db0e86dd2011-03-16 14:47:2196
97#if defined(OS_CHROMEOS)
[email protected]5b869962011-09-20 19:49:3398 // Returns the out-of-memory priority manager.
[email protected]38489a32012-05-11 02:24:5499 virtual chromeos::OomPriorityManager* oom_priority_manager() = 0;
[email protected]db0e86dd2011-03-16 14:47:21100#endif // defined(OS_CHROMEOS)
101
[email protected]5a38dfd2012-07-23 23:22:10102 virtual extensions::EventRouterForwarder*
[email protected]3ce02412011-03-01 12:01:15103 extension_event_router_forwarder() = 0;
initial.commit09911bf2008-07-26 23:55:29104
[email protected]29672ab2009-10-30 03:44:03105 // Returns the manager for desktop notifications.
106 virtual NotificationUIManager* notification_ui_manager() = 0;
107
[email protected]ed10dd12011-12-07 12:03:42108 // Returns the state object for the thread that we perform I/O
109 // coordination on (network requests, communication with renderers,
110 // etc.
111 //
112 // Can be NULL close to startup and shutdown.
113 //
114 // NOTE: If you want to post a task to the IO thread, use
115 // BrowserThread::PostTask (or other variants).
[email protected]0ac83682010-01-22 17:46:27116 virtual IOThread* io_thread() = 0;
initial.commit09911bf2008-07-26 23:55:29117
[email protected]0b565182011-03-02 18:11:15118 // Returns the thread that is used for health check of all browser threads.
119 virtual WatchDogThread* watchdog_thread() = 0;
120
[email protected]a4179c2a2012-02-09 18:14:21121 // Starts and manages the policy system.
[email protected]985655a2011-02-23 09:54:25122 virtual policy::BrowserPolicyConnector* browser_policy_connector() = 0;
[email protected]f2a893c2011-01-05 09:38:07123
[email protected]a4179c2a2012-02-09 18:14:21124 // This is the main interface for chromium components to retrieve policy
125 // information from the policy system.
126 virtual policy::PolicyService* policy_service() = 0;
127
initial.commit09911bf2008-07-26 23:55:29128 virtual IconManager* icon_manager() = 0;
129
[email protected]94e385322012-10-08 20:21:33130 virtual RenderWidgetSnapshotTaker* GetRenderWidgetSnapshotTaker() = 0;
[email protected]58dca552009-06-17 00:35:02131
[email protected]120655d2011-09-16 22:10:32132 virtual AutomationProviderList* GetAutomationProviderList() = 0;
initial.commit09911bf2008-07-26 23:55:29133
[email protected]76698ea2012-08-24 20:50:37134 virtual void CreateDevToolsHttpProtocolHandler(
[email protected]4475d232011-07-27 15:29:20135 Profile* profile,
[email protected]01000cf12011-02-04 11:39:22136 const std::string& ip,
[email protected]5613126e2011-01-31 15:27:55137 int port,
138 const std::string& frontend_url) = 0;
139
initial.commit09911bf2008-07-26 23:55:29140 virtual unsigned int AddRefModule() = 0;
141 virtual unsigned int ReleaseModule() = 0;
142
143 virtual bool IsShuttingDown() = 0;
144
initial.commit09911bf2008-07-26 23:55:29145 virtual printing::PrintJobManager* print_job_manager() = 0;
[email protected]dbeebd52010-11-16 20:34:16146 virtual printing::PrintPreviewTabController*
147 print_preview_tab_controller() = 0;
[email protected]68f88b992011-05-07 02:01:39148 virtual printing::BackgroundPrintingManager*
149 background_printing_manager() = 0;
initial.commit09911bf2008-07-26 23:55:29150
[email protected]c4ff4952010-01-08 19:12:47151 virtual IntranetRedirectDetector* intranet_redirect_detector() = 0;
initial.commit09911bf2008-07-26 23:55:29152
153 // Returns the locale used by the application.
[email protected]d70539de2009-06-24 22:17:06154 virtual const std::string& GetApplicationLocale() = 0;
[email protected]f1b6de22010-03-06 12:13:47155 virtual void SetApplicationLocale(const std::string& locale) = 0;
initial.commit09911bf2008-07-26 23:55:29156
[email protected]073ed7b2010-09-27 09:20:02157 virtual DownloadStatusUpdater* download_status_updater() = 0;
[email protected]254ed742011-08-16 18:45:27158 virtual DownloadRequestLimiter* download_request_limiter() = 0;
[email protected]4cdac102008-10-17 18:07:02159
[email protected]9e7f015f2011-05-28 00:24:25160 // Returns the object that manages background applications.
161 virtual BackgroundModeManager* background_mode_manager() = 0;
162
163 // Returns the StatusTray, which provides an API for displaying status icons
164 // in the system status tray. Returns NULL if status icons are not supported
165 // on this platform (or this is a unit test).
166 virtual StatusTray* status_tray() = 0;
167
[email protected]462a0ff2011-06-02 17:15:34168 // Returns the SafeBrowsing service.
169 virtual SafeBrowsingService* safe_browsing_service() = 0;
170
[email protected]a7a5e992010-12-09 23:39:51171 // Returns an object which handles communication with the SafeBrowsing
172 // client-side detection servers.
173 virtual safe_browsing::ClientSideDetectionService*
174 safe_browsing_detection_service() = 0;
175
[email protected]8b08a47f2011-02-25 12:36:37176 // Returns the state of the disable plugin finder policy. Callable only on
177 // the IO thread.
178 virtual bool plugin_finder_disabled() const = 0;
179
[email protected]3cdacd42010-04-30 18:55:53180#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
[email protected]bd48c2b02010-04-09 20:32:42181 // This will start a timer that, if Chrome is in persistent mode, will check
182 // whether an update is available, and if that's the case, restart the
183 // browser. Note that restart code will strip some of the command line keys
184 // and all loose values from the cl this instance of Chrome was launched with,
185 // and add the command line key that will force Chrome to start in the
186 // background mode. For the full list of "blacklisted" keys, refer to
187 // |kSwitchesToRemoveOnAutorestart| array in browser_process_impl.cc.
188 virtual void StartAutoupdateTimer() = 0;
[email protected]3cdacd42010-04-30 18:55:53189#endif
[email protected]bd48c2b02010-04-09 20:32:42190
[email protected]d6f37fc2011-02-13 23:58:41191 virtual ChromeNetLog* net_log() = 0;
192
[email protected]1459fb62011-05-25 19:03:27193 virtual prerender::PrerenderTracker* prerender_tracker() = 0;
194
[email protected]c1adf5a2011-08-03 22:11:37195 virtual ComponentUpdateService* component_updater() = 0;
196
[email protected]ca167a32011-09-30 15:19:11197 virtual CRLSetFetcher* crl_set_fetcher() = 0;
198
initial.commit09911bf2008-07-26 23:55:29199 private:
[email protected]bfd04a62009-02-01 18:16:56200 DISALLOW_COPY_AND_ASSIGN(BrowserProcess);
initial.commit09911bf2008-07-26 23:55:29201};
202
203extern BrowserProcess* g_browser_process;
204
[email protected]bfd04a62009-02-01 18:16:56205#endif // CHROME_BROWSER_BROWSER_PROCESS_H_