summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-09-20 18:13:54 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-09-23 22:36:36 +0000
commitc30109f24b253756bec249b3cd8853aa90fe0923 (patch)
tree95d9a925b1b15e2924f8eb25bd6d2abcdc8b19dc /src/core
parent1ecf3ac50b4ceca4b2b398089912a40aa7450ef1 (diff)
Enable Chromium content-layer WebUI
Enables the WebUI sources implemented in the content-layer, these are mostly internals that are not supposed to be used by end-users, but chrome://gpu is particularly interesting for us. This enables the following schemes: chrome://appcache-internals chrome://blob-internals chrome://histograms chrome://indexeddb-internals chrome://media-internals chrome://network-errors chrome://serviceworker-internals chrome://view-http-cache chrome://webrtc-internals and chrome://gpu Change-Id: Ib297f8fa2e3c15ca464a2c49022e0257d27c532b Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/content_client_qt.cpp5
-rw-r--r--src/core/content_client_qt.h1
-rw-r--r--src/core/url_request_context_getter_qt.cpp5
3 files changed, 10 insertions, 1 deletions
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 2725ab9e4..0dac5e48b 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -292,6 +292,11 @@ base::StringPiece ContentClientQt::GetDataResource(int resource_id, ui::ScaleFac
return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(resource_id, scale_factor);
}
+base::RefCountedMemory *ContentClientQt::GetDataResourceBytes(int resource_id) const
+{
+ return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
+}
+
base::string16 ContentClientQt::GetLocalizedString(int message_id) const
{
return l10n_util::GetStringUTF16(message_id);
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index 6a5584cc7..4fd539bf3 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -56,6 +56,7 @@ public:
#endif
virtual base::StringPiece GetDataResource(int, ui::ScaleFactor) const Q_DECL_OVERRIDE;
+ virtual base::RefCountedMemory* GetDataResourceBytes(int resource_id) const Q_DECL_OVERRIDE;
virtual std::string GetUserAgent() const Q_DECL_OVERRIDE { return getUserAgent(); }
virtual base::string16 GetLocalizedString(int message_id) const Q_DECL_OVERRIDE;
virtual std::string GetProduct() const Q_DECL_OVERRIDE;
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index 25f7e36e6..e5df27135 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -525,10 +525,13 @@ void URLRequestContextGetterQt::generateJobFactory()
std::unique_ptr<net::URLRequestJobFactoryImpl> jobFactory(new net::URLRequestJobFactoryImpl());
{
- // Chromium has a few protocol handlers ready for us, only pick blob: and throw away the rest.
+ // Chromium has transferred a few protocol handlers to us, only pick blob: and chrome: and ignore the rest.
content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(url::kBlobScheme);
Q_ASSERT(it != m_protocolHandlers.end());
jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release()));
+ it = m_protocolHandlers.find(content::kChromeUIScheme);
+ Q_ASSERT(it != m_protocolHandlers.end());
+ jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release()));
m_protocolHandlers.clear();
}