~phablet-team/webbrowser-app/15.04

« back to all changes in this revision

Viewing changes to src/Ubuntu/Web/plugin.cpp

  • Committer: CI Train Bot
  • Author(s): Alexandre Abreu
  • Date: 2015-04-10 13:33:10 UTC
  • mfrom: (955.3.2 remove-qtwebkit)
  • Revision ID: ci-train-bot@canonical.com-20150410133310-x2mbbmfuml090wqh
remove qtwebkit deps (LP: #1362640) Fixes: #1362640
Approved by: Timo Jyrinki, PS Jenkins bot, Olivier Tilloy

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
    return m_devtoolsPort;
182
182
}
183
183
 
184
 
static float getQtWebkitDpr()
185
 
{
186
 
    QByteArray stringValue = qgetenv("QTWEBKIT_DPR");
187
 
    bool ok = false;
188
 
    float value = stringValue.toFloat(&ok);
189
 
    return ok ? value : 1.0;
190
 
}
191
 
 
192
184
void UbuntuBrowserPlugin::initializeEngine(QQmlEngine* engine, const char* uri)
193
185
{
194
186
    Q_UNUSED(uri);
196
188
    QQmlContext* context = engine->rootContext();
197
189
    context->setContextObject(new UbuntuWebPluginContext(context));
198
190
 
199
 
    if (uri == QLatin1String("Ubuntu.Components.Extras.Browser")) {
200
 
        // Set the desired pixel ratio (not needed once we use Qt’s way of
201
 
        // calculating the proper pixel ratio by device/screen).
202
 
        context->setContextProperty("QtWebKitDPR", getQtWebkitDpr());
203
 
    }
204
191
}
205
192
 
206
193
void UbuntuBrowserPlugin::registerTypes(const char* uri)