2013-10-23 21:30:47 +02:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions (c) 2011 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2016-07-18 23:22:22 +02:00
|
|
|
// This file provides a stub implementation of Chrome's BrowserProcess object
|
|
|
|
// for use as an interop layer between CEF and files that live in chrome/.
|
|
|
|
|
2020-06-28 20:29:44 +02:00
|
|
|
#ifndef CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_
|
2013-10-23 21:30:47 +02:00
|
|
|
|
2016-07-18 23:22:22 +02:00
|
|
|
#include <memory>
|
2013-10-23 21:30:47 +02:00
|
|
|
#include <string>
|
|
|
|
|
2019-09-04 17:13:32 +02:00
|
|
|
#include "base/metrics/field_trial.h"
|
2013-10-23 21:30:47 +02:00
|
|
|
#include "chrome/browser/browser_process.h"
|
2016-07-18 23:22:22 +02:00
|
|
|
#include "chrome/browser/extensions/event_router_forwarder.h"
|
2018-04-19 17:44:42 +02:00
|
|
|
#include "media/media_buildflags.h"
|
2013-10-23 21:30:47 +02:00
|
|
|
|
2022-01-28 22:16:29 +01:00
|
|
|
namespace extensions {
|
|
|
|
class ExtensionsBrowserClient;
|
|
|
|
class ExtensionsClient;
|
|
|
|
} // namespace extensions
|
|
|
|
|
2020-06-28 20:29:44 +02:00
|
|
|
class ChromeProfileManagerAlloy;
|
2013-10-23 21:30:47 +02:00
|
|
|
|
|
|
|
class BackgroundModeManager {
|
|
|
|
public:
|
|
|
|
BackgroundModeManager();
|
2017-05-17 11:29:28 +02:00
|
|
|
|
2021-12-06 21:40:25 +01:00
|
|
|
BackgroundModeManager(const BackgroundModeManager&) = delete;
|
|
|
|
BackgroundModeManager& operator=(const BackgroundModeManager&) = delete;
|
|
|
|
|
|
|
|
virtual ~BackgroundModeManager();
|
2013-10-23 21:30:47 +02:00
|
|
|
};
|
|
|
|
|
2020-06-28 20:29:44 +02:00
|
|
|
class ChromeBrowserProcessAlloy : public BrowserProcess {
|
2013-10-23 21:30:47 +02:00
|
|
|
public:
|
2020-06-28 20:29:44 +02:00
|
|
|
ChromeBrowserProcessAlloy();
|
2021-12-06 21:40:25 +01:00
|
|
|
|
|
|
|
ChromeBrowserProcessAlloy(const ChromeBrowserProcessAlloy&) = delete;
|
|
|
|
ChromeBrowserProcessAlloy& operator=(const ChromeBrowserProcessAlloy&) =
|
|
|
|
delete;
|
|
|
|
|
2020-06-28 20:29:44 +02:00
|
|
|
~ChromeBrowserProcessAlloy() override;
|
2013-10-23 21:30:47 +02:00
|
|
|
|
2017-10-20 19:45:20 +02:00
|
|
|
void Initialize();
|
2016-11-07 20:14:09 +01:00
|
|
|
void OnContextInitialized();
|
2020-06-24 22:26:12 +02:00
|
|
|
void CleanupOnUIThread();
|
2016-07-18 23:22:22 +02:00
|
|
|
|
2013-10-23 21:30:47 +02:00
|
|
|
// BrowserProcess implementation.
|
2014-11-12 20:25:15 +01:00
|
|
|
void EndSession() override;
|
2017-09-06 23:40:58 +02:00
|
|
|
void FlushLocalStateAndReply(base::OnceClosure reply) override;
|
2023-04-04 20:00:13 +02:00
|
|
|
device::GeolocationManager* geolocation_manager() override;
|
2017-05-17 11:29:28 +02:00
|
|
|
metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager()
|
|
|
|
override;
|
2014-11-12 20:25:15 +01:00
|
|
|
metrics::MetricsService* metrics_service() override;
|
2017-09-06 23:40:58 +02:00
|
|
|
SystemNetworkContextManager* system_network_context_manager() override;
|
2018-07-02 19:11:49 +02:00
|
|
|
network::NetworkQualityTracker* network_quality_tracker() override;
|
2023-05-30 10:55:32 +02:00
|
|
|
embedder_support::OriginTrialsSettingsStorage*
|
|
|
|
GetOriginTrialsSettingsStorage() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
ProfileManager* profile_manager() override;
|
|
|
|
PrefService* local_state() override;
|
2018-07-13 21:29:20 +02:00
|
|
|
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory()
|
|
|
|
override;
|
2015-10-09 17:23:12 +02:00
|
|
|
variations::VariationsService* variations_service() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
BrowserProcessPlatformPart* platform_part() override;
|
2017-05-17 11:29:28 +02:00
|
|
|
extensions::EventRouterForwarder* extension_event_router_forwarder() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
NotificationUIManager* notification_ui_manager() override;
|
2016-05-25 01:35:43 +02:00
|
|
|
NotificationPlatformBridge* notification_platform_bridge() override;
|
2023-04-04 20:00:13 +02:00
|
|
|
void SetGeolocationManager(
|
|
|
|
std::unique_ptr<device::GeolocationManager> geolocation_manager) override;
|
2018-02-15 01:12:09 +01:00
|
|
|
policy::ChromeBrowserPolicyConnector* browser_policy_connector() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
policy::PolicyService* policy_service() override;
|
|
|
|
IconManager* icon_manager() override;
|
|
|
|
GpuModeManager* gpu_mode_manager() override;
|
2018-03-20 21:15:08 +01:00
|
|
|
void CreateDevToolsProtocolHandler() override;
|
2016-03-16 03:55:59 +01:00
|
|
|
void CreateDevToolsAutoOpener() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsShuttingDown() override;
|
|
|
|
printing::PrintJobManager* print_job_manager() override;
|
2017-05-17 11:29:28 +02:00
|
|
|
printing::PrintPreviewDialogController* print_preview_dialog_controller()
|
|
|
|
override;
|
|
|
|
printing::BackgroundPrintingManager* background_printing_manager() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
IntranetRedirectDetector* intranet_redirect_detector() override;
|
|
|
|
const std::string& GetApplicationLocale() override;
|
|
|
|
void SetApplicationLocale(const std::string& locale) override;
|
|
|
|
DownloadStatusUpdater* download_status_updater() override;
|
|
|
|
DownloadRequestLimiter* download_request_limiter() override;
|
2020-06-27 22:43:23 +02:00
|
|
|
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
2014-11-12 20:25:15 +01:00
|
|
|
BackgroundModeManager* background_mode_manager() override;
|
|
|
|
void set_background_mode_manager_for_test(
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<BackgroundModeManager> manager) override;
|
2020-06-27 22:43:23 +02:00
|
|
|
#endif
|
2014-11-12 20:25:15 +01:00
|
|
|
StatusTray* status_tray() override;
|
2015-12-09 17:10:16 +01:00
|
|
|
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
|
2018-11-30 23:21:07 +01:00
|
|
|
subresource_filter::RulesetService* subresource_filter_ruleset_service()
|
|
|
|
override;
|
2019-07-16 19:59:21 +02:00
|
|
|
StartupData* startup_data() override;
|
2013-10-23 21:30:47 +02:00
|
|
|
|
2022-01-24 18:58:02 +01:00
|
|
|
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
|
2014-11-12 20:25:15 +01:00
|
|
|
void StartAutoupdateTimer() override;
|
2013-10-23 21:30:47 +02:00
|
|
|
#endif
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
component_updater::ComponentUpdateService* component_updater() override;
|
|
|
|
MediaFileSystemRegistry* media_file_system_registry() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
WebRtcLogUploader* webrtc_log_uploader() override;
|
|
|
|
network_time::NetworkTimeTracker* network_time_tracker() override;
|
|
|
|
gcm::GCMDriver* gcm_driver() override;
|
2017-07-27 01:19:27 +02:00
|
|
|
resource_coordinator::TabManager* GetTabManager() override;
|
2018-11-30 23:21:07 +01:00
|
|
|
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
|
|
|
|
override;
|
2020-03-30 22:13:42 +02:00
|
|
|
BuildState* GetBuildState() override;
|
2021-07-23 18:40:13 +02:00
|
|
|
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
|
2022-02-21 23:23:40 +01:00
|
|
|
HidPolicyAllowedDevices* hid_policy_allowed_devices() override;
|
2023-01-03 00:34:43 +01:00
|
|
|
HidSystemTrayIcon* hid_system_tray_icon() override;
|
2013-10-23 21:30:47 +02:00
|
|
|
|
|
|
|
private:
|
2016-07-18 23:22:22 +02:00
|
|
|
bool initialized_;
|
2016-11-07 20:14:09 +01:00
|
|
|
bool context_initialized_;
|
2016-07-18 23:22:22 +02:00
|
|
|
bool shutdown_;
|
|
|
|
|
2022-01-28 22:16:29 +01:00
|
|
|
std::unique_ptr<extensions::ExtensionsClient> extensions_client_;
|
|
|
|
std::unique_ptr<extensions::ExtensionsBrowserClient>
|
|
|
|
extensions_browser_client_;
|
|
|
|
|
2013-10-23 21:30:47 +02:00
|
|
|
std::string locale_;
|
2016-07-18 23:22:22 +02:00
|
|
|
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
|
2020-06-28 20:29:44 +02:00
|
|
|
std::unique_ptr<ChromeProfileManagerAlloy> profile_manager_;
|
2016-07-18 23:22:22 +02:00
|
|
|
scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_;
|
2019-07-17 20:47:27 +02:00
|
|
|
scoped_refptr<printing::PrintPreviewDialogController>
|
|
|
|
print_preview_dialog_controller_;
|
|
|
|
std::unique_ptr<printing::BackgroundPrintingManager>
|
|
|
|
background_printing_manager_;
|
2019-03-21 01:23:23 +01:00
|
|
|
std::unique_ptr<PrefService> local_state_;
|
2022-08-23 03:37:40 +02:00
|
|
|
|
2019-03-21 01:23:23 +01:00
|
|
|
// Must be destroyed after |local_state_|.
|
|
|
|
std::unique_ptr<policy::ChromeBrowserPolicyConnector>
|
|
|
|
browser_policy_connector_;
|
2019-09-04 17:13:32 +02:00
|
|
|
std::unique_ptr<base::FieldTrialList> field_trial_list_;
|
2013-10-23 21:30:47 +02:00
|
|
|
|
2021-08-09 23:18:43 +02:00
|
|
|
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
|
2013-10-23 21:30:47 +02:00
|
|
|
};
|
|
|
|
|
2020-06-28 20:29:44 +02:00
|
|
|
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_
|