summaryrefslogtreecommitdiffstats
path: root/src/core/url_request_context_getter_qt.cpp
diff options
context:
space:
mode:
authorXiao Zhang <xiaozhang1@blackberry.com>2013-12-03 14:16:38 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-06 03:16:35 +0100
commitab7da2095d495da0e346cee2745b61d83588abe6 (patch)
tree03862aa622e262515e51635e870c666ded56cfd3 /src/core/url_request_context_getter_qt.cpp
parent8e0283cb450746cba967bf2d78b2d627e9202fe6 (diff)
Add qrc protocol handler.
Support qrc resources in html. For example: <script type="text/javascript" src="qrc:///xx.js"></script> <image src="qrc:///xx.png"></image> Change-Id: I490efb7cc300bf894659e79948b65729a12ad73d Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src/core/url_request_context_getter_qt.cpp')
-rw-r--r--src/core/url_request_context_getter_qt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index 99bf68b1c..933df845c 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -63,6 +63,9 @@
#include "net/url_request/file_protocol_handler.h"
#include "network_delegate_qt.h"
+#include "qrc_protocol_handler_qt.h"
+
+static const char kQrcSchemeQt[] = "qrc";
using content::BrowserThread;
@@ -159,6 +162,7 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
m_jobFactory.reset(new net::URLRequestJobFactoryImpl());
m_jobFactory->SetProtocolHandler(chrome::kDataScheme, new net::DataProtocolHandler());
m_jobFactory->SetProtocolHandler(chrome::kFileScheme, new net::FileProtocolHandler());
+ m_jobFactory->SetProtocolHandler(kQrcSchemeQt, new QrcProtocolHandlerQt());
m_urlRequestContext->set_job_factory(m_jobFactory.get());
}