2018-10-11 13:52:12 +00:00
|
|
|
// Copyright (c) 2012 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.
|
|
|
|
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/browser_process_impl.h"
|
2018-10-11 13:52:12 +00:00
|
|
|
|
2019-09-16 22:12:00 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2018-11-06 06:10:04 +00:00
|
|
|
#include <utility>
|
|
|
|
|
2020-07-22 05:34:34 +00:00
|
|
|
#include "base/command_line.h"
|
2021-05-26 19:16:55 +00:00
|
|
|
#include "base/files/file_path.h"
|
|
|
|
#include "base/path_service.h"
|
2023-01-06 02:35:34 +00:00
|
|
|
#include "chrome/browser/browser_process.h"
|
2021-06-15 00:32:56 +00:00
|
|
|
#include "chrome/common/chrome_paths.h"
|
2018-11-06 06:10:04 +00:00
|
|
|
#include "chrome/common/chrome_switches.h"
|
2023-10-24 15:24:20 +00:00
|
|
|
#include "components/os_crypt/async/browser/key_provider.h"
|
|
|
|
#include "components/os_crypt/async/browser/os_crypt_async.h"
|
2023-03-20 11:06:57 +00:00
|
|
|
#include "components/os_crypt/sync/os_crypt.h"
|
2018-11-06 06:10:04 +00:00
|
|
|
#include "components/prefs/in_memory_pref_store.h"
|
2021-05-26 19:16:55 +00:00
|
|
|
#include "components/prefs/json_pref_store.h"
|
2018-11-06 06:10:04 +00:00
|
|
|
#include "components/prefs/overlay_user_pref_store.h"
|
|
|
|
#include "components/prefs/pref_registry.h"
|
|
|
|
#include "components/prefs/pref_registry_simple.h"
|
|
|
|
#include "components/prefs/pref_service_factory.h"
|
|
|
|
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
|
|
|
|
#include "components/proxy_config/proxy_config_dictionary.h"
|
|
|
|
#include "components/proxy_config/proxy_config_pref_names.h"
|
2020-01-15 00:20:30 +00:00
|
|
|
#include "content/public/browser/child_process_security_policy.h"
|
2023-05-31 15:06:25 +00:00
|
|
|
#include "content/public/browser/network_quality_observer_factory.h"
|
|
|
|
#include "content/public/browser/network_service_instance.h"
|
2018-11-06 06:10:04 +00:00
|
|
|
#include "content/public/common/content_switches.h"
|
2021-05-26 19:16:55 +00:00
|
|
|
#include "electron/fuses.h"
|
2020-01-15 00:20:30 +00:00
|
|
|
#include "extensions/common/constants.h"
|
2018-11-06 06:10:04 +00:00
|
|
|
#include "net/proxy_resolution/proxy_config.h"
|
|
|
|
#include "net/proxy_resolution/proxy_config_service.h"
|
|
|
|
#include "net/proxy_resolution/proxy_config_with_annotation.h"
|
2024-03-15 18:03:42 +00:00
|
|
|
#include "services/device/public/cpp/geolocation/geolocation_system_permission_manager.h"
|
2018-11-07 13:23:09 +00:00
|
|
|
#include "services/network/public/cpp/network_switches.h"
|
2024-02-22 17:08:25 +00:00
|
|
|
#include "shell/browser/net/resolve_proxy_helper.h"
|
2021-05-26 19:16:55 +00:00
|
|
|
#include "shell/common/electron_paths.h"
|
2022-11-17 19:59:23 +00:00
|
|
|
#include "shell/common/thread_restrictions.h"
|
2018-10-11 13:52:12 +00:00
|
|
|
|
2018-10-13 01:57:04 +00:00
|
|
|
#if BUILDFLAG(ENABLE_PRINTING)
|
2018-11-09 03:42:34 +00:00
|
|
|
#include "chrome/browser/printing/print_job_manager.h"
|
2018-10-13 01:57:04 +00:00
|
|
|
#endif
|
2018-11-09 03:42:34 +00:00
|
|
|
|
|
|
|
BrowserProcessImpl::BrowserProcessImpl() {
|
2018-10-11 13:52:12 +00:00
|
|
|
g_browser_process = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
BrowserProcessImpl::~BrowserProcessImpl() {
|
|
|
|
g_browser_process = nullptr;
|
|
|
|
}
|
|
|
|
|
2018-11-06 06:10:04 +00:00
|
|
|
// static
|
|
|
|
void BrowserProcessImpl::ApplyProxyModeFromCommandLine(
|
|
|
|
ValueMapPrefStore* pref_store) {
|
|
|
|
if (!pref_store)
|
|
|
|
return;
|
|
|
|
|
|
|
|
auto* command_line = base::CommandLine::ForCurrentProcess();
|
|
|
|
|
|
|
|
if (command_line->HasSwitch(switches::kNoProxyServer)) {
|
2022-10-17 14:22:24 +00:00
|
|
|
pref_store->SetValue(proxy_config::prefs::kProxy,
|
|
|
|
base::Value(ProxyConfigDictionary::CreateDirect()),
|
|
|
|
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
|
2018-11-06 06:10:04 +00:00
|
|
|
} else if (command_line->HasSwitch(switches::kProxyPacUrl)) {
|
|
|
|
std::string pac_script_url =
|
|
|
|
command_line->GetSwitchValueASCII(switches::kProxyPacUrl);
|
2022-10-17 14:22:24 +00:00
|
|
|
pref_store->SetValue(proxy_config::prefs::kProxy,
|
|
|
|
base::Value(ProxyConfigDictionary::CreatePacScript(
|
|
|
|
pac_script_url, false /* pac_mandatory */)),
|
|
|
|
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
|
2018-11-06 06:10:04 +00:00
|
|
|
} else if (command_line->HasSwitch(switches::kProxyAutoDetect)) {
|
|
|
|
pref_store->SetValue(proxy_config::prefs::kProxy,
|
2022-10-17 14:22:24 +00:00
|
|
|
base::Value(ProxyConfigDictionary::CreateAutoDetect()),
|
2018-11-06 06:10:04 +00:00
|
|
|
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
|
|
|
|
} else if (command_line->HasSwitch(switches::kProxyServer)) {
|
|
|
|
std::string proxy_server =
|
|
|
|
command_line->GetSwitchValueASCII(switches::kProxyServer);
|
|
|
|
std::string bypass_list =
|
|
|
|
command_line->GetSwitchValueASCII(switches::kProxyBypassList);
|
2022-10-17 14:22:24 +00:00
|
|
|
pref_store->SetValue(proxy_config::prefs::kProxy,
|
|
|
|
base::Value(ProxyConfigDictionary::CreateFixedServers(
|
|
|
|
proxy_server, bypass_list)),
|
|
|
|
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
|
2018-11-06 06:10:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-06 07:05:30 +00:00
|
|
|
BuildState* BrowserProcessImpl::GetBuildState() {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
chore: bump chromium to 128.0.6611.0 (32-x-y) (#43017)
* chore: bump chromium to 128.0.6611.0 (main) (#42779)
* chore: bump chromium in DEPS to 128.0.6577.0
* chore: bump chromium in DEPS to 128.0.6579.0
* 5675706: Reland "Reland "Reland "Reland "Add toolchains without PartitionAlloc-Everywhere for dump_syms et al""""
https://chromium-review.googlesource.com/c/chromium/src/+/5675706
* 5668597: [PDF Ink Signatures] Prompt download menu on save when there are edits
https://chromium-review.googlesource.com/c/chromium/src/+/5668597
* 5677014: Reland "Pull data_sharing_sdk from CIPD"
https://chromium-review.googlesource.com/c/chromium/src/+/5677014
* chore: fixup patch indices
* chore: bump chromium in DEPS to 128.0.6581.0
* chore: bump chromium in DEPS to 128.0.6583.0
* update patches
* 5455480: [Extensions] Allow service worker requests to continue without a cert
https://chromium-review.googlesource.com/c/chromium/src/+/5455480
* try to get some debugging output from script/push-patch.js
* chore: bump chromium in DEPS to 128.0.6585.0
* chore: bump chromium in DEPS to 128.0.6587.0
* update patches
* chore: bump chromium in DEPS to 128.0.6589.0
* more patch work
* maybe over here?
* chore: update patches
* 5673207: [HTTPS Upgrades] Disable in captive portal login webview
https://chromium-review.googlesource.com/c/chromium/src/+/5673207
* 5636785: Extensions: WAR: manifest.json's use_dynamic_url requires a dynamic url
https://chromium-review.googlesource.com/c/chromium/src/+/5636785
* chore: bump chromium in DEPS to 128.0.6591.0
* 5665458: Trigger WN2 page when feature is enabled
https://chromium-review.googlesource.com/c/chromium/src/+/5665458
* update patches
* chore: bump chromium in DEPS to 128.0.6593.0
* chore: bump chromium in DEPS to 128.0.6595.0
* chore: bump chromium in DEPS to 128.0.6597.0
* (patch update) 5694586: [compile hints] Remove the usage of v8::Isolate::SetJavaScriptCompileHintsMagicEnabledCallback API
https://chromium-review.googlesource.com/c/chromium/src/+/5694586
* update patches
* 5691287: Reland "Change blink::WebKeyboardEvent to use std::array in is members"
https://chromium-review.googlesource.com/c/chromium/src/+/5691287
The code changed here is modeled after code in `content/renderer/pepper/event_conversion.cc` that was also modified in this CL, so I took the same approach.
* 5529018: Cleanup EnableWebHidOnExtensionServiceWorker flag
https://chromium-review.googlesource.com/c/chromium/src/+/5529018
* 5526324: [Code Health] Add deprecation comment for base::SupportsWeakPtr.
https://chromium-review.googlesource.com/c/chromium/src/+/5526324
Note that this CL actually does make `SupportsWeakPtr` strictly restricted to existing implementations, no new ones. We could add a patch to add ourselves to this list, but it looks like we'll have to refactor this anyways in the near future. Since the refactor seems straightforward, let's try that first.
* chore: bump chromium in DEPS to 128.0.6598.0
* chore: update patches
* 5704737: Rename ExclusiveAccessContext::GetActiveWebContents to avoid conflict
https://chromium-review.googlesource.com/c/chromium/src/+/5704737
* chore: bump chromium in DEPS to 128.0.6601.0
* chore: update patches
* Add `base::StringPiece` header includes
Chromium is working on replacing `base::StringPiece` with `std::string_view`. (See the Chromium Bug below.) They're currently running mass codemods (across many multiple changes) to replace uses of `StringPiece` with `string_view`, including removing the header include for `StringPiece` in those files. This cascades down to our files that were implicitly depending on those includes through some other include.
They're on track to eventually deprecate and remove `StringPiece` so our code should be converted, but that can be done as an upgrade follow-up task. For now, adding the header back to files that need it should suffice for minimal upgrade changes.
Chromium Bug: https://issues.chromium.org/issues/40506050
* 5702737: GlobalRequestID: Avoid unwanted inlining and narrowing int conversions
https://chromium-review.googlesource.com/c/chromium/src/+/5702737
contender for smallest commit 2024
* 5706534: Rename GlobalFeatures to GlobalDesktopFeatures.
https://chromium-review.googlesource.com/c/chromium/src/+/5706534
* 5691321: ui: remove params variants of SelectFile listener functions
https://chromium-review.googlesource.com/c/chromium/src/+/5691321
* 5714949: [Extensions] Display re-enable dialog for MV2 disabled stage
https://chromium-review.googlesource.com/c/chromium/src/+/5714949
* chore: update libc++ filenames
* patch: disable scope reuse & associated dchecks in v8 (hopefully temp, upgrade follow-up)
* fixup! Add `base::StringPiece` header includes
* update MAS patch
5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception
https://chromium-review.googlesource.com/c/chromium/src/+/5710330
* chore: bump chromium in DEPS to 128.0.6603.0
* chore: update patches
* 5713258: Reland "Preparation for decoupling creation/initialization of context"
https://chromium-review.googlesource.com/c/chromium/src/+/5713258
When destroying a context, it must already be shutdown, and this change enforces it with a new CHECK.
We were overriding `BrowserContextKeyedServiceFactory::BrowserContextShutdown` with an empty implementation, which differed from the default implementation that notifies the `KeyedServiceFactory` that the context has shutdown. Since we were missing this notification, the CHECK would later trip when the service was being destoryed because it was not registered as shutdown when it was shutdown.
* chore: bump chromium in DEPS to 128.0.6605.2
* chore: update patches
* refactor: linux open/save dialog patch
Our existing implementation was relying on an opaque `void* params` parameter that was passed through `ui::SelectFileDialog`.
Recently, that parameter has been getting removed:
- 5691321: ui: remove params variants of SelectFile listener functions | https://chromium-review.googlesource.com/c/chromium/src/+/5691321
- 5709097: ui: remove SelectFileDialog impl params | https://chromium-review.googlesource.com/c/chromium/src/+/5709097
- https://issues.chromium.org/issues/340178601 "reconsider SelectFileDialog"
This restructures the patch to work with mostly the same mechanics, but directly on the `ui::SelectFileDialog` object. This nets us some wins in terms of a smaller patch.
* 5713262: DevTools UI binding AIDA client event returns response
https://chromium-review.googlesource.com/c/chromium/src/+/5713262
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6606.0
* chore: update patches
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6607.0
* chore: update printing.patch
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5722937
* fix: pwd error in electron-test, nan-test
fix: unshallow depot_tools before 3-way apply
* chore: e patches all
* fixup! fix: pwd error in electron-test, nan-test
* chore: bump chromium in DEPS to 128.0.6609.0
* chore: bump chromium in DEPS to 128.0.6611.0
* chore: update patches
* chore: update libcxx filenames
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Alice Zhao <alice@makenotion.com>
* chore: delete duplicate declaration from merge conflict
* chore: bump chromium in DEPS to 128.0.6613.7
* Revert "chore: bump chromium in DEPS to 128.0.6613.7"
This reverts commit 78047428269c79d4d3532619daf0f07e307f4dbc.
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-07-25 09:24:11 +00:00
|
|
|
GlobalDesktopFeatures* BrowserProcessImpl::GetDesktopFeatures() {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-11-06 06:10:04 +00:00
|
|
|
void BrowserProcessImpl::PostEarlyInitialization() {
|
|
|
|
PrefServiceFactory prefs_factory;
|
|
|
|
auto pref_registry = base::MakeRefCounted<PrefRegistrySimple>();
|
|
|
|
PrefProxyConfigTrackerImpl::RegisterPrefs(pref_registry.get());
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_WIN)
|
2021-05-26 19:16:55 +00:00
|
|
|
OSCrypt::RegisterLocalPrefs(pref_registry.get());
|
|
|
|
#endif
|
|
|
|
|
2024-02-22 17:08:25 +00:00
|
|
|
in_memory_pref_store_ = base::MakeRefCounted<ValueMapPrefStore>();
|
|
|
|
ApplyProxyModeFromCommandLine(in_memory_pref_store());
|
|
|
|
prefs_factory.set_command_line_prefs(in_memory_pref_store());
|
2021-05-26 19:16:55 +00:00
|
|
|
|
|
|
|
// Only use a persistent prefs store when cookie encryption is enabled as that
|
|
|
|
// is the only key that needs it
|
2021-08-05 22:12:54 +00:00
|
|
|
base::FilePath prefs_path;
|
2022-05-09 14:26:57 +00:00
|
|
|
CHECK(base::PathService::Get(electron::DIR_SESSION_DATA, &prefs_path));
|
2021-08-05 22:12:54 +00:00
|
|
|
prefs_path = prefs_path.Append(FILE_PATH_LITERAL("Local State"));
|
2022-11-17 19:59:23 +00:00
|
|
|
electron::ScopedAllowBlockingForElectron allow_blocking;
|
2021-08-05 22:12:54 +00:00
|
|
|
scoped_refptr<JsonPrefStore> user_pref_store =
|
|
|
|
base::MakeRefCounted<JsonPrefStore>(prefs_path);
|
|
|
|
user_pref_store->ReadPrefs();
|
|
|
|
prefs_factory.set_user_prefs(user_pref_store);
|
2018-11-06 06:10:04 +00:00
|
|
|
local_state_ = prefs_factory.Create(std::move(pref_registry));
|
|
|
|
}
|
|
|
|
|
2019-07-03 01:22:09 +00:00
|
|
|
void BrowserProcessImpl::PreCreateThreads() {
|
2020-01-15 00:20:30 +00:00
|
|
|
// chrome-extension:// URLs are safe to request anywhere, but may only
|
|
|
|
// commit (including in iframes) in extension processes.
|
|
|
|
content::ChildProcessSecurityPolicy::GetInstance()
|
|
|
|
->RegisterWebSafeIsolatedScheme(extensions::kExtensionScheme, true);
|
2018-11-06 06:10:04 +00:00
|
|
|
// Must be created before the IOThread.
|
|
|
|
// Once IOThread class is no longer needed,
|
|
|
|
// this can be created on first use.
|
2019-03-26 01:10:48 +00:00
|
|
|
if (!SystemNetworkContextManager::GetInstance())
|
|
|
|
SystemNetworkContextManager::CreateInstance(local_state_.get());
|
2018-11-06 06:10:04 +00:00
|
|
|
}
|
|
|
|
|
2023-05-31 15:06:25 +00:00
|
|
|
void BrowserProcessImpl::PreMainMessageLoopRun() {
|
|
|
|
CreateNetworkQualityObserver();
|
2023-10-24 15:24:20 +00:00
|
|
|
CreateOSCryptAsync();
|
2023-05-31 15:06:25 +00:00
|
|
|
}
|
|
|
|
|
2018-11-06 06:10:04 +00:00
|
|
|
void BrowserProcessImpl::PostMainMessageLoopRun() {
|
2019-03-26 01:10:48 +00:00
|
|
|
if (local_state_)
|
|
|
|
local_state_->CommitPendingWrite();
|
|
|
|
|
2018-11-06 06:10:04 +00:00
|
|
|
// This expects to be destroyed before the task scheduler is torn down.
|
2019-03-26 01:10:48 +00:00
|
|
|
SystemNetworkContextManager::DeleteInstance();
|
2018-11-06 06:10:04 +00:00
|
|
|
}
|
|
|
|
|
2018-10-11 13:52:12 +00:00
|
|
|
bool BrowserProcessImpl::IsShuttingDown() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
metrics_services_manager::MetricsServicesManager*
|
|
|
|
BrowserProcessImpl::GetMetricsServicesManager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
metrics::MetricsService* BrowserProcessImpl::metrics_service() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
ProfileManager* BrowserProcessImpl::profile_manager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
PrefService* BrowserProcessImpl::local_state() {
|
2018-11-06 06:10:04 +00:00
|
|
|
DCHECK(local_state_.get());
|
|
|
|
return local_state_.get();
|
2018-10-11 13:52:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
scoped_refptr<network::SharedURLLoaderFactory>
|
|
|
|
BrowserProcessImpl::shared_url_loader_factory() {
|
2018-11-07 14:24:05 +00:00
|
|
|
return system_network_context_manager()->GetSharedURLLoaderFactory();
|
2018-10-11 13:52:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
variations::VariationsService* BrowserProcessImpl::variations_service() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
BrowserProcessPlatformPart* BrowserProcessImpl::platform_part() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
extensions::EventRouterForwarder*
|
|
|
|
BrowserProcessImpl::extension_event_router_forwarder() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
NotificationUIManager* BrowserProcessImpl::notification_ui_manager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
NotificationPlatformBridge* BrowserProcessImpl::notification_platform_bridge() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
SystemNetworkContextManager*
|
|
|
|
BrowserProcessImpl::system_network_context_manager() {
|
2019-03-26 01:10:48 +00:00
|
|
|
DCHECK(SystemNetworkContextManager::GetInstance());
|
|
|
|
return SystemNetworkContextManager::GetInstance();
|
2018-10-11 13:52:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
network::NetworkQualityTracker* BrowserProcessImpl::network_quality_tracker() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2023-05-23 19:58:58 +00:00
|
|
|
embedder_support::OriginTrialsSettingsStorage*
|
|
|
|
BrowserProcessImpl::GetOriginTrialsSettingsStorage() {
|
|
|
|
return &origin_trials_settings_storage_;
|
|
|
|
}
|
|
|
|
|
2018-10-11 13:52:12 +00:00
|
|
|
policy::ChromeBrowserPolicyConnector*
|
|
|
|
BrowserProcessImpl::browser_policy_connector() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
policy::PolicyService* BrowserProcessImpl::policy_service() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
IconManager* BrowserProcessImpl::icon_manager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpuModeManager* BrowserProcessImpl::gpu_mode_manager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
printing::PrintPreviewDialogController*
|
|
|
|
BrowserProcessImpl::print_preview_dialog_controller() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
printing::BackgroundPrintingManager*
|
|
|
|
BrowserProcessImpl::background_printing_manager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
IntranetRedirectDetector* BrowserProcessImpl::intranet_redirect_detector() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
DownloadStatusUpdater* BrowserProcessImpl::download_status_updater() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusTray* BrowserProcessImpl::status_tray() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
safe_browsing::SafeBrowsingService*
|
|
|
|
BrowserProcessImpl::safe_browsing_service() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2019-01-09 22:55:35 +00:00
|
|
|
subresource_filter::RulesetService*
|
2018-10-11 13:52:12 +00:00
|
|
|
BrowserProcessImpl::subresource_filter_ruleset_service() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
component_updater::ComponentUpdateService*
|
|
|
|
BrowserProcessImpl::component_updater() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
MediaFileSystemRegistry* BrowserProcessImpl::media_file_system_registry() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
WebRtcLogUploader* BrowserProcessImpl::webrtc_log_uploader() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
network_time::NetworkTimeTracker* BrowserProcessImpl::network_time_tracker() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
gcm::GCMDriver* BrowserProcessImpl::gcm_driver() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2019-01-10 00:47:31 +00:00
|
|
|
resource_coordinator::ResourceCoordinatorParts*
|
|
|
|
BrowserProcessImpl::resource_coordinator_parts() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-10-11 13:52:12 +00:00
|
|
|
resource_coordinator::TabManager* BrowserProcessImpl::GetTabManager() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-06-05 02:03:31 +00:00
|
|
|
SerialPolicyAllowedPorts* BrowserProcessImpl::serial_policy_allowed_ports() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2023-01-06 02:35:34 +00:00
|
|
|
HidSystemTrayIcon* BrowserProcessImpl::hid_system_tray_icon() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2023-07-18 22:26:27 +00:00
|
|
|
UsbSystemTrayIcon* BrowserProcessImpl::usb_system_tray_icon() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2024-04-15 22:10:32 +00:00
|
|
|
subresource_filter::RulesetService*
|
|
|
|
BrowserProcessImpl::fingerprinting_protection_ruleset_service() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2023-10-24 15:24:20 +00:00
|
|
|
os_crypt_async::OSCryptAsync* BrowserProcessImpl::os_crypt_async() {
|
|
|
|
return os_crypt_async_.get();
|
|
|
|
}
|
|
|
|
|
2024-06-07 21:18:35 +00:00
|
|
|
void BrowserProcessImpl::set_additional_os_crypt_async_provider_for_test(
|
|
|
|
size_t precedence,
|
|
|
|
std::unique_ptr<os_crypt_async::KeyProvider> provider) {}
|
|
|
|
|
2022-09-23 18:50:46 +00:00
|
|
|
void BrowserProcessImpl::SetSystemLocale(const std::string& locale) {
|
|
|
|
system_locale_ = locale;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& BrowserProcessImpl::GetSystemLocale() const {
|
|
|
|
return system_locale_;
|
|
|
|
}
|
|
|
|
|
2024-02-22 17:08:25 +00:00
|
|
|
electron::ResolveProxyHelper* BrowserProcessImpl::GetResolveProxyHelper() {
|
|
|
|
if (!resolve_proxy_helper_) {
|
|
|
|
resolve_proxy_helper_ = base::MakeRefCounted<electron::ResolveProxyHelper>(
|
2024-07-15 12:50:38 +00:00
|
|
|
nullptr /* browser_context */);
|
2024-02-22 17:08:25 +00:00
|
|
|
}
|
|
|
|
return resolve_proxy_helper_.get();
|
|
|
|
}
|
|
|
|
|
2023-07-13 09:14:33 +00:00
|
|
|
#if BUILDFLAG(IS_LINUX)
|
|
|
|
void BrowserProcessImpl::SetLinuxStorageBackend(
|
|
|
|
os_crypt::SelectedLinuxBackend selected_backend) {
|
|
|
|
switch (selected_backend) {
|
|
|
|
case os_crypt::SelectedLinuxBackend::BASIC_TEXT:
|
|
|
|
selected_linux_storage_backend_ = "basic_text";
|
|
|
|
break;
|
|
|
|
case os_crypt::SelectedLinuxBackend::GNOME_LIBSECRET:
|
|
|
|
selected_linux_storage_backend_ = "gnome_libsecret";
|
|
|
|
break;
|
|
|
|
case os_crypt::SelectedLinuxBackend::KWALLET:
|
|
|
|
selected_linux_storage_backend_ = "kwallet";
|
|
|
|
break;
|
|
|
|
case os_crypt::SelectedLinuxBackend::KWALLET5:
|
|
|
|
selected_linux_storage_backend_ = "kwallet5";
|
|
|
|
break;
|
|
|
|
case os_crypt::SelectedLinuxBackend::KWALLET6:
|
|
|
|
selected_linux_storage_backend_ = "kwallet6";
|
|
|
|
break;
|
|
|
|
case os_crypt::SelectedLinuxBackend::DEFER:
|
|
|
|
NOTREACHED();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // BUILDFLAG(IS_LINUX)
|
|
|
|
|
2018-10-11 13:52:12 +00:00
|
|
|
void BrowserProcessImpl::SetApplicationLocale(const std::string& locale) {
|
|
|
|
locale_ = locale;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& BrowserProcessImpl::GetApplicationLocale() {
|
|
|
|
return locale_;
|
|
|
|
}
|
|
|
|
|
|
|
|
printing::PrintJobManager* BrowserProcessImpl::print_job_manager() {
|
2018-11-09 03:42:34 +00:00
|
|
|
#if BUILDFLAG(ENABLE_PRINTING)
|
|
|
|
if (!print_job_manager_)
|
2019-09-16 22:12:00 +00:00
|
|
|
print_job_manager_ = std::make_unique<printing::PrintJobManager>();
|
2018-10-11 13:52:12 +00:00
|
|
|
return print_job_manager_.get();
|
2018-11-09 03:42:34 +00:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2018-10-11 13:52:12 +00:00
|
|
|
}
|
2019-05-01 20:42:49 +00:00
|
|
|
|
|
|
|
StartupData* BrowserProcessImpl::startup_data() {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2023-03-16 10:03:53 +00:00
|
|
|
|
2023-05-31 15:06:25 +00:00
|
|
|
network::NetworkQualityTracker* BrowserProcessImpl::GetNetworkQualityTracker() {
|
|
|
|
if (!network_quality_tracker_) {
|
|
|
|
network_quality_tracker_ = std::make_unique<network::NetworkQualityTracker>(
|
|
|
|
base::BindRepeating(&content::GetNetworkService));
|
|
|
|
}
|
|
|
|
return network_quality_tracker_.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
void BrowserProcessImpl::CreateNetworkQualityObserver() {
|
|
|
|
DCHECK(!network_quality_observer_);
|
|
|
|
network_quality_observer_ =
|
|
|
|
content::CreateNetworkQualityObserver(GetNetworkQualityTracker());
|
|
|
|
DCHECK(network_quality_observer_);
|
|
|
|
}
|
2023-10-24 15:24:20 +00:00
|
|
|
|
|
|
|
void BrowserProcessImpl::CreateOSCryptAsync() {
|
|
|
|
// source: https://chromium-review.googlesource.com/c/chromium/src/+/4455776
|
|
|
|
|
|
|
|
// For now, initialize OSCryptAsync with no providers. This delegates all
|
|
|
|
// encryption operations to OSCrypt.
|
|
|
|
// TODO(crbug.com/1373092): Add providers behind features, as support for them
|
|
|
|
// is added.
|
|
|
|
os_crypt_async_ = std::make_unique<os_crypt_async::OSCryptAsync>(
|
|
|
|
std::vector<
|
|
|
|
std::pair<size_t, std::unique_ptr<os_crypt_async::KeyProvider>>>());
|
|
|
|
|
|
|
|
// Trigger async initialization of OSCrypt key providers.
|
|
|
|
std::ignore = os_crypt_async_->GetInstance(base::DoNothing());
|
|
|
|
}
|