Import the demo browser into widget examples.

Import the sources as-is, without adding it to the build, to allow
performing diffs later on the changes that were needed to port it
to use QtWebEngine and manage source compatibility issues.

Change-Id: Icf8a284881ce2153e9b5a1ba97dbe77096f1b88d
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
demo browser: Fix the compilation with QtWebEngine.

This makes the demo compile, but not link since
most of the methods aren't implemented yet.

Also disable downloads and printing since they require a bit
more work to instead use the page directly.

Change-Id: I59adfe07fda077c6909f70f12800a4cfa6a6dad2
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
demo browser: Make it link.

The ifdefs should later be removed along with the feature
implementations.

Change-Id: If73f4c4c02c00e90d6cf54c6a08bb37f43fa95bc
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Import relevant QtWebKit API tests.

This import the tests as-is, without adding them to the build.

Change-Id: I8b8e11a9f62b2a8f2be299347d2621b10fb61f20
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
API tests: Make them compile with QtWebEngine.

They still won't link since most methods aren't implemented yet.

The changes to tst_qwebengineframe.cpp are mostly esthetic as those
tests should be merged with tst_qwebenginepage.cpp once the
implementation has progressed a bit further.

Change-Id: If6627820069b51d7461d667716aafa6e250a684b
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
API tests: Make them link.

Add the tests to the build. Very few of the test cases pass
already, but this should allow to progress on the
implementation while fixing/unskipping those tests.

Change-Id: Id96d22748f8effad963232c2451fb8719d299fee
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Let the application sanitize the URL.

Do like the QtQuick example and let the Widgets example use urlFromUserInput
to add a missing http scheme instead of letting QtWebEngine do it.

This is the same behavior as QtWebKit does.

Change-Id: Iac1570523253126e059afb00c3a2ff844e177ff1
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Centralize type conversion functions.

This adds the common GURL->QUrl and string16->QString conversions
into a common header and use those functions throughout the code.
Move the qStringToStringType into the same header and rename it
to a name consistent with the others.

This also cleans up shared_globals.h by moving content:: forward
declarations in the cpp, where they are used.

Change-Id: I19527ea7de1f6047aae8b44c97eb4d7c3e5a0e54
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Implement QWebEnginePage::action for basic navigation.

This imports code from qwebpage.cpp and QWebPageAdapter.cpp of WebKit
into qwebenginepage.cpp and thus also restrict the license accordingly.

Change-Id: Ic5da8f2b469109cb10132cbe6585f2d941b14403
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Use the WebContentsAdapter directly in QWebEngineHistory.

Change-Id: Iac80388e8d3a789b336ab88b75c6fa6048a3c446
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Implement the basic parts of QWebEngineHistory.

Mark the remaining methods as not implemented to allow enabling most
of the dependent code in the demo browser and in API tests.
Add two new tests to cover cases that might be problematic with the
index-based implementation.

This also renames WebContentsAdapter::navigateHistory to navigateToOffset
in order to avoid confusion with navigateToIndex.

Change-Id: I7c5cb9f5f878e34206fdfe48334a2dc7d9d95a1d
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Reviewed-by: Andras Becsi <andras.becsi@digia.com>