refactor: move printing out of chromium_src (#15023)

* remove printing related things from chromium_src

* chore: add printing build flag and patch

* fix: include PrintingService on other platforms too

* fix: printing_handler is only needed on Windows

* fix: format BUILD.gn properly

* fix: rename printing build flag to avoid conflict with chromium

* fix: place previously missed printing calls behind build flag

* fix: accidentally renamed flag in patch file

* fix: don't include all printing strings

* fix: allow ShowItemInFolder and OpenItem to block, fixing a DCHECK crash

* fix: make things compile, some changes got lost while rebasing

* fix: remove rogue line from BUILD.gn

* chore: update patch description

* style: lint fix

* chore: use chromium printing buildflag, move node related stuff out of patch

* revert: remove ScopedAllowBlockingForTesting call

* fix: fix my rebase blooper

* fix: re-add header lost during rebase, update patch

* fix: add <map> include, tweak the patch a bit

* revert: remove rogue diff from patch

* fix: clean up after rebase
This commit is contained in:
Heilig Benedek 2018-10-13 03:57:04 +02:00 committed by Samuel Attard
parent c806c465fa
commit a82bcc7e3c
53 changed files with 1398 additions and 7358 deletions

View file

@ -59,6 +59,7 @@
#include "net/base/escape.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "printing/buildflags/buildflags.h"
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
@ -88,6 +89,10 @@
#include "chrome/browser/speech/tts_message_filter.h"
#endif // BUILDFLAG(ENABLE_TTS)
#if BUILDFLAG(ENABLE_PRINTING)
#include "chrome/services/printing/public/mojom/constants.mojom.h"
#endif // BUILDFLAG(ENABLE_PRINTING)
using content::BrowserThread;
namespace atom {
@ -209,7 +214,9 @@ void AtomBrowserClient::RenderProcessWillLaunch(
if (IsProcessObserved(process_id))
return;
#if BUILDFLAG(ENABLE_PRINTING)
host->AddFilter(new printing::PrintingMessageFilter(process_id));
#endif
#if BUILDFLAG(ENABLE_TTS)
host->AddFilter(new TtsMessageFilter(host->GetBrowserContext()));
@ -535,6 +542,12 @@ void AtomBrowserClient::RegisterOutOfProcessServices(
(*services)[proxy_resolver::mojom::kProxyResolverServiceName] =
base::BindRepeating(&l10n_util::GetStringUTF16,
IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME);
#if BUILDFLAG(ENABLE_PRINTING)
(*services)[printing::mojom::kChromePrintingServiceName] =
base::BindRepeating(&l10n_util::GetStringUTF16,
IDS_UTILITY_PROCESS_PRINTING_SERVICE_NAME);
#endif
}
std::unique_ptr<base::Value> AtomBrowserClient::GetServiceManifestOverlay(