summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorChris Hutten-Czapski <chutten@blackberry.com>2013-10-09 10:42:35 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 16:26:57 +0100
commitf21cb5bc6fca478541d804d24ca0b60a96d82e8f (patch)
tree66922b25198677290112d735f7ec131a586283aa /shared
parenteabac4c9ca887b86bcebbfd2d2afd77ed8cc1a6a (diff)
QtWebEngine Dev Tools (Web Inspector)
To implement the Web Inspector we need a delegate to handle the http server and devtools connections, a landing page, a ContentClient to tell the devtools server where to find its frontend resources, those frontend resources, and an API for embedders to turn on inspectability in WebEngineViews. The frontend resources are build by the chromium build and are copied over as part of lib's build. The landing page was taken directly from content_shell. This should be replaced by either a new one for all QtWebEngine embedders or by a mechanism for embedders to supply their own (or both). Change-Id: Id4076d5ede34a91abf8dba443aed4dca4be1b3e5 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'shared')
-rw-r--r--shared/resource_bundle_qt.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/shared/resource_bundle_qt.cpp b/shared/resource_bundle_qt.cpp
index af26a488a..044d00511 100644
--- a/shared/resource_bundle_qt.cpp
+++ b/shared/resource_bundle_qt.cpp
@@ -43,6 +43,7 @@
#include "ui/base/resource/data_pack.h"
#include <QFile>
+#include <QStringList>
namespace ui {
@@ -135,13 +136,19 @@ class UI_EXPORT DataPackQt : public DataPack {
void ResourceBundle::LoadCommonResources()
{
- QFile pak_file(":/data/resources.pak");
- if (!pak_file.open(QIODevice::ReadOnly))
- return;
+ QStringList resources;
+ resources << ":/data/resources.pak" << ":/data/devtools.pak";
+ Q_FOREACH (const QString& pak, resources) {
+ QFile pak_file(pak);
+ if (!pak_file.open(QIODevice::ReadOnly)) {
+ qWarning("Resource file %s not loaded", qPrintable(pak));
+ continue;
+ }
- scoped_ptr<DataPackQt> data_pack(new DataPackQt(SCALE_FACTOR_100P));
- if (data_pack->LoadFromByteArray(pak_file.readAll()))
- AddDataPack(data_pack.release());
+ scoped_ptr<DataPackQt> data_pack(new DataPackQt(SCALE_FACTOR_100P));
+ if (data_pack->LoadFromByteArray(pak_file.readAll()))
+ AddDataPack(data_pack.release());
+ }
}
// As GetLocaleFilePath is excluded for Mac in resource_bundle.cc,