Merge lp:~abreu-alexandre/webbrowser-app/backport-devtools-webview-trusty into lp:webbrowser-app/trusty

Proposed by Alexandre Abreu
Status: Needs review
Proposed branch: lp:~abreu-alexandre/webbrowser-app/backport-devtools-webview-trusty
Merge into: lp:webbrowser-app/trusty
Diff against target: 78 lines (+38/-1)
3 files modified
debian/control (+1/-1)
src/Ubuntu/Components/Extras/Browser/UbuntuWebContext.qml (+4/-0)
src/Ubuntu/Components/Extras/Browser/plugin.cpp (+33/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/webbrowser-app/backport-devtools-webview-trusty
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+243412@code.launchpad.net

Commit message

Backport devtools webview to trusty

Description of the change

Backport devtools webview plugin properties to trusty

To post a comment you must log in.

Unmerged revisions

509. By Alexandre Abreu

backport devtools in webview plugin to T

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-04-11 15:53:45 +0000
3+++ debian/control 2014-12-02 15:56:36 +0000
4@@ -65,7 +65,7 @@
5 ${shlibs:Depends},
6 libqt5sql5-sqlite,
7 libqt5webkit5-qmlwebkitplugin,
8- liboxideqt-qmlplugin,
9+ liboxideqt-qmlplugin (>= 1.2.6),
10 qtdeclarative5-qtquick2-plugin,
11 qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets (>= ${source:Version}),
12 qtdeclarative5-ubuntu-ui-toolkit-plugin,
13
14=== modified file 'src/Ubuntu/Components/Extras/Browser/UbuntuWebContext.qml'
15--- src/Ubuntu/Components/Extras/Browser/UbuntuWebContext.qml 2014-04-10 10:29:35 +0000
16+++ src/Ubuntu/Components/Extras/Browser/UbuntuWebContext.qml 2014-12-02 15:56:36 +0000
17@@ -64,6 +64,10 @@
18 matchAllFrames: true
19 }
20 ]
21+
22+ devtoolsEnabled: webviewDevtoolsDebugPort !== -1
23+ devtoolsPort: webviewDevtoolsDebugPort
24+ devtoolsIp: webviewDevtoolsDebugHost
25 }
26
27 UserAgent02 {
28
29=== modified file 'src/Ubuntu/Components/Extras/Browser/plugin.cpp'
30--- src/Ubuntu/Components/Extras/Browser/plugin.cpp 2014-03-19 22:17:40 +0000
31+++ src/Ubuntu/Components/Extras/Browser/plugin.cpp 2014-12-02 15:56:36 +0000
32@@ -63,6 +63,36 @@
33 return DESKTOP;
34 }
35
36+static int getDevtoolsPort()
37+{
38+ const int DEVTOOLS_INVALID_PORT = -1;
39+
40+ int port = DEVTOOLS_INVALID_PORT;
41+ const char* DEVTOOLS_PORT_ENV_VAR = "UBUNTU_WEBVIEW_DEVTOOLS_PORT";
42+
43+ if (qEnvironmentVariableIsSet(DEVTOOLS_PORT_ENV_VAR)) {
44+ QByteArray environmentVarValue = qgetenv(DEVTOOLS_PORT_ENV_VAR);
45+ bool ok = false;
46+ int value = environmentVarValue.toInt(&ok);
47+ if (ok) {
48+ port = value;
49+ }
50+ }
51+ return port > 0 ? port : DEVTOOLS_INVALID_PORT;
52+}
53+
54+
55+static QString getDevtoolsHost()
56+{
57+ QString host;
58+ const char* DEVTOOLS_HOST_ENV_VAR = "UBUNTU_WEBVIEW_DEVTOOLS_HOST";
59+
60+ if (qEnvironmentVariableIsSet(DEVTOOLS_HOST_ENV_VAR)) {
61+ host = qgetenv(DEVTOOLS_HOST_ENV_VAR);
62+ }
63+ return host;
64+}
65+
66 void UbuntuBrowserPlugin::initializeEngine(QQmlEngine* engine, const char* uri)
67 {
68 Q_UNUSED(uri);
69@@ -79,6 +109,9 @@
70 context->setContextProperty("QtWebKitDPR", getQtWebkitDpr());
71
72 context->setContextProperty("formFactor", getFormFactor());
73+
74+ context->setContextProperty("webviewDevtoolsDebugPort", getDevtoolsPort());
75+ context->setContextProperty("webviewDevtoolsDebugHost", getDevtoolsHost());
76 }
77
78 void UbuntuBrowserPlugin::registerTypes(const char* uri)

Subscribers

People subscribed via source and target branches