mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-03-15 11:30:11 +01:00
alloy: Add support for chrome-untrusted scheme (see issue #3047)
Lack of this functionality was causing print preview to fail with PdfUnseasoned enabled.
This commit is contained in:
parent
71727464b8
commit
efc0a67e00
@ -32,6 +32,7 @@
|
||||
#include "cef/grit/cef_resources.h"
|
||||
#include "chrome/browser/browser_about_handler.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.h"
|
||||
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
|
||||
#include "chrome/browser/ui/webui/theme_source.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
@ -581,6 +582,11 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory {
|
||||
if (controller.get())
|
||||
return controller;
|
||||
|
||||
controller = ChromeUntrustedWebUIControllerFactory::GetInstance()
|
||||
->CreateWebUIControllerForURL(web_ui, url);
|
||||
if (controller.get())
|
||||
return controller;
|
||||
|
||||
return ChromeWebUIControllerFactory::GetInstance()
|
||||
->CreateWebUIControllerForURL(web_ui, url);
|
||||
}
|
||||
@ -601,6 +607,11 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory {
|
||||
if (type != content::WebUI::kNoWebUI)
|
||||
return type;
|
||||
|
||||
type = ChromeUntrustedWebUIControllerFactory::GetInstance()->GetWebUIType(
|
||||
browser_context, url);
|
||||
if (type != content::WebUI::kNoWebUI)
|
||||
return type;
|
||||
|
||||
type = ChromeWebUIControllerFactory::GetInstance()->GetWebUIType(
|
||||
browser_context, url);
|
||||
if (type != content::WebUI::kNoWebUI)
|
||||
@ -621,6 +632,8 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory {
|
||||
|
||||
if (content::ContentWebUIControllerFactory::GetInstance()->UseWebUIForURL(
|
||||
browser_context, url) ||
|
||||
ChromeUntrustedWebUIControllerFactory::GetInstance()->UseWebUIForURL(
|
||||
browser_context, url) ||
|
||||
ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL(
|
||||
browser_context, url)) {
|
||||
return true;
|
||||
|
@ -539,5 +539,11 @@ patches = [
|
||||
# Remove DCHECK that triggers while loading DevTools resources.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=1289230
|
||||
'name': 'blink_security_policy_1289230',
|
||||
},
|
||||
{
|
||||
# Add ChromeUntrustedWebUIControllerFactory::GetInstance() method.
|
||||
# https://crrev.com/643a88a591e1fa448c9ee72679498e4288e7a164
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3047
|
||||
'name': 'chrome_untrusted_webui_3047',
|
||||
}
|
||||
]
|
||||
|
34
patch/patches/chrome_untrusted_webui_3047.patch
Normal file
34
patch/patches/chrome_untrusted_webui_3047.patch
Normal file
@ -0,0 +1,34 @@
|
||||
diff --git chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc
|
||||
index 78d2b6eef6ca6..ebefa586902c9 100644
|
||||
--- chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc
|
||||
+++ chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.cc
|
||||
@@ -94,9 +94,15 @@ WebUIConfigList CreateConfigs() {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
-void ChromeUntrustedWebUIControllerFactory::RegisterInstance() {
|
||||
+ChromeUntrustedWebUIControllerFactory*
|
||||
+ChromeUntrustedWebUIControllerFactory::GetInstance() {
|
||||
static base::NoDestructor<ChromeUntrustedWebUIControllerFactory> instance;
|
||||
- content::WebUIControllerFactory::RegisterFactory(instance.get());
|
||||
+ return instance.get();
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+void ChromeUntrustedWebUIControllerFactory::RegisterInstance() {
|
||||
+ content::WebUIControllerFactory::RegisterFactory(GetInstance());
|
||||
}
|
||||
|
||||
ChromeUntrustedWebUIControllerFactory::ChromeUntrustedWebUIControllerFactory()
|
||||
diff --git chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.h chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.h
|
||||
index fd16bca71a3f0..738afa6654e42 100644
|
||||
--- chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.h
|
||||
+++ chrome/browser/ui/webui/chrome_untrusted_web_ui_controller_factory.h
|
||||
@@ -12,6 +12,7 @@ class ChromeUntrustedWebUIControllerFactory
|
||||
public:
|
||||
// Register the singleton instance of this class.
|
||||
static void RegisterInstance();
|
||||
+ static ChromeUntrustedWebUIControllerFactory* GetInstance();
|
||||
|
||||
ChromeUntrustedWebUIControllerFactory();
|
||||
ChromeUntrustedWebUIControllerFactory(
|
Loading…
x
Reference in New Issue
Block a user