diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2016-11-10 17:10:20 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2016-11-11 13:39:59 +0000 |
commit | e83c722db43351329e451e84420a6b69591bc076 (patch) | |
tree | 1bac6d506b8e87fdf269a548c19a2bbbed608c26 /src | |
parent | c27374541e289962df6947967b97178bfa63e9f7 (diff) |
Make view source working with qrc URLs
Task-number: QTBUG-56353
Change-Id: I9c5dc3a6ba4e6b08ecbb4e44d38a53d24010807b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 6 | ||||
-rw-r--r-- | src/core/content_browser_client_qt.h | 1 | ||||
-rw-r--r-- | src/core/qrc_protocol_handler_qt.cpp | 2 | ||||
-rw-r--r-- | src/core/qrc_protocol_handler_qt.h | 2 | ||||
-rw-r--r-- | src/core/url_request_context_getter_qt.cpp | 2 |
5 files changed, 11 insertions, 2 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index c3800e9ff..787586540 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -85,6 +85,7 @@ #if defined(ENABLE_BASIC_PRINTING) #include "printing_message_filter_qt.h" #endif // defined(ENABLE_BASIC_PRINTING) +#include "qrc_protocol_handler_qt.h" #include "renderer_host/resource_dispatcher_host_delegate_qt.h" #include "renderer_host/user_resource_controller_host.h" #include "web_contents_delegate_qt.h" @@ -507,6 +508,11 @@ void ContentBrowserClientQt::AppendExtraCommandLineSwitches(base::CommandLine* c command_line->AppendSwitchASCII(switches::kLang, GetApplicationLocale()); } +void ContentBrowserClientQt::GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes) +{ + additional_schemes->push_back(kQrcSchemeQt); +} + #if defined(Q_OS_LINUX) void ContentBrowserClientQt::GetAdditionalMappedFilesForChildProcess(const base::CommandLine& command_line, int child_process_id, content::FileDescriptorInfo* mappings) { diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index 47b880643..a13d14ff2 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -108,6 +108,7 @@ public: virtual std::string GetApplicationLocale() Q_DECL_OVERRIDE; std::string GetAcceptLangs(content::BrowserContext* context) Q_DECL_OVERRIDE; virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) Q_DECL_OVERRIDE; + virtual void GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes) Q_DECL_OVERRIDE; #if defined(Q_OS_LINUX) virtual void GetAdditionalMappedFilesForChildProcess(const base::CommandLine& command_line, int child_process_id, content::FileDescriptorInfo* mappings) Q_DECL_OVERRIDE; diff --git a/src/core/qrc_protocol_handler_qt.cpp b/src/core/qrc_protocol_handler_qt.cpp index 222961762..eb716f182 100644 --- a/src/core/qrc_protocol_handler_qt.cpp +++ b/src/core/qrc_protocol_handler_qt.cpp @@ -46,6 +46,8 @@ namespace QtWebEngineCore { +const char kQrcSchemeQt[] = "qrc"; + QrcProtocolHandlerQt::QrcProtocolHandlerQt() { } diff --git a/src/core/qrc_protocol_handler_qt.h b/src/core/qrc_protocol_handler_qt.h index 53d063810..a2e0cc00b 100644 --- a/src/core/qrc_protocol_handler_qt.h +++ b/src/core/qrc_protocol_handler_qt.h @@ -53,6 +53,8 @@ class URLRequestJob; namespace QtWebEngineCore { +extern const char kQrcSchemeQt[]; + // Implements a ProtocolHandler for qrc file jobs. If |network_delegate_| is NULL, // then all file requests will fail with ERR_ACCESS_DENIED. class QrcProtocolHandlerQt : public net::URLRequestJobFactory::ProtocolHandler { diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index 61f359a87..bf4661102 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -91,8 +91,6 @@ namespace QtWebEngineCore { -static const char kQrcSchemeQt[] = "qrc"; - using content::BrowserThread; URLRequestContextGetterQt::URLRequestContextGetterQt(QSharedPointer<BrowserContextAdapter> browserContext, content::ProtocolHandlerMap *protocolHandlers, content::URLRequestInterceptorScopedVector request_interceptors) |