summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-11-10 11:42:10 +0100
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-11-10 11:55:08 +0100
commite929af148b233526d23cb3bf40d8335c9497c4e7 (patch)
treea20398847cf22f97c303856b99cb382beff3b593
parent0b5a7d6132164994221fd83f70e705772337137e (diff)
parentf343e9d69a9aa8d64fe61725cf17c824f8f2d703 (diff)
Merge remote-tracking branch 'origin/5.4' into 5.4.0
-rw-r--r--examples/webengine/quicknanobrowser/quickwindow.qml4
-rw-r--r--examples/webengine/quicknanobrowser/util.h2
-rw-r--r--examples/webenginewidgets/browser/browsermainwindow.cpp4
-rw-r--r--examples/webenginewidgets/browser/browsermainwindow.h2
-rw-r--r--examples/webenginewidgets/browser/data/defaultbookmarks.xbel11
-rw-r--r--examples/webenginewidgets/browser/featurepermissionbar.cpp6
-rw-r--r--examples/webenginewidgets/browser/settings.cpp2
-rw-r--r--examples/webenginewidgets/browser/webview.cpp5
-rw-r--r--src/core/browser_context_qt.cpp14
-rw-r--r--src/core/browser_context_qt.h1
-rw-r--r--src/core/url_request_context_getter_qt.cpp9
-rw-r--r--src/core/url_request_context_getter_qt.h5
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp16
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h16
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc8
-rw-r--r--tests/quicktestbrowser/quickwindow.qml8
16 files changed, 71 insertions, 42 deletions
diff --git a/examples/webengine/quicknanobrowser/quickwindow.qml b/examples/webengine/quicknanobrowser/quickwindow.qml
index c6b03418c..610144dca 100644
--- a/examples/webengine/quicknanobrowser/quickwindow.qml
+++ b/examples/webengine/quicknanobrowser/quickwindow.qml
@@ -51,8 +51,8 @@ ApplicationWindow {
function load(url) { currentWebView.url = url }
property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item : null
- height: 600
- width: 800
+ width: 1300
+ height: 900
visible: true
title: currentWebView && currentWebView.title
diff --git a/examples/webengine/quicknanobrowser/util.h b/examples/webengine/quicknanobrowser/util.h
index bad41d6a7..bc1cf8beb 100644
--- a/examples/webengine/quicknanobrowser/util.h
+++ b/examples/webengine/quicknanobrowser/util.h
@@ -66,7 +66,7 @@ QUrl startupUrl()
if (ret.isValid())
return ret;
}
- return QUrl(QStringLiteral("http://qt-project.org/"));
+ return QUrl(QStringLiteral("http://qt.io/"));
}
diff --git a/examples/webenginewidgets/browser/browsermainwindow.cpp b/examples/webenginewidgets/browser/browsermainwindow.cpp
index 587e66490..cce603cff 100644
--- a/examples/webenginewidgets/browser/browsermainwindow.cpp
+++ b/examples/webenginewidgets/browser/browsermainwindow.cpp
@@ -88,6 +88,8 @@ InvokeWrapper<Arg, R, C> invoke(R *receiver, void (C::*memberFun)(Arg))
return wrapper;
}
+const char *BrowserMainWindow::defaultHome = "http://qt.io/";
+
BrowserMainWindow::BrowserMainWindow(QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags)
, m_tabWidget(new TabWidget(this))
@@ -825,7 +827,7 @@ void BrowserMainWindow::slotHome()
{
QSettings settings;
settings.beginGroup(QLatin1String("MainWindow"));
- QString home = settings.value(QLatin1String("home"), QLatin1String("http://qt-project.org/")).toString();
+ QString home = settings.value(QLatin1String("home"), QLatin1String(defaultHome)).toString();
loadPage(home);
}
diff --git a/examples/webenginewidgets/browser/browsermainwindow.h b/examples/webenginewidgets/browser/browsermainwindow.h
index 6743d8e79..da767e35e 100644
--- a/examples/webenginewidgets/browser/browsermainwindow.h
+++ b/examples/webenginewidgets/browser/browsermainwindow.h
@@ -70,6 +70,8 @@ public:
~BrowserMainWindow();
QSize sizeHint() const;
+ static const char *defaultHome;
+
public:
TabWidget *tabWidget() const;
WebView *currentTab() const;
diff --git a/examples/webenginewidgets/browser/data/defaultbookmarks.xbel b/examples/webenginewidgets/browser/data/defaultbookmarks.xbel
index 7a95e36b3..a981d2de2 100644
--- a/examples/webenginewidgets/browser/data/defaultbookmarks.xbel
+++ b/examples/webenginewidgets/browser/data/defaultbookmarks.xbel
@@ -3,18 +3,12 @@
<xbel version="1.0">
<folder folded="yes">
<title>Bookmarks Bar</title>
- <bookmark href="http://qt-project.org/">
+ <bookmark href="http://qt.io/">
<title>Qt Home Page</title>
</bookmark>
- <bookmark href="http://webkit.org/">
- <title>WebKit.org</title>
- </bookmark>
<bookmark href="http://qt-project.org/doc/">
<title>Qt Documentation</title>
</bookmark>
- <bookmark href="http://qt-project.org/quarterly/">
- <title>Qt Quarterly</title>
- </bookmark>
<bookmark href="http://planet.qt-project.org/">
<title>Qt Blog</title>
</bookmark>
@@ -27,6 +21,9 @@
<bookmark href="http://qt-project.org/wiki/OnlineCommunities/">
<title>Online Communities</title>
</bookmark>
+ <bookmark href="http://www.chromium.org/">
+ <title>The Chromium Projects</title>
+ </bookmark>
<bookmark href="http://xkcd.com/">
<title>xkcd</title>
</bookmark>
diff --git a/examples/webenginewidgets/browser/featurepermissionbar.cpp b/examples/webenginewidgets/browser/featurepermissionbar.cpp
index 2cc9907bd..98f19ad1f 100644
--- a/examples/webenginewidgets/browser/featurepermissionbar.cpp
+++ b/examples/webenginewidgets/browser/featurepermissionbar.cpp
@@ -56,11 +56,11 @@ static QString textForPermissionType(QWebEnginePage::Feature type)
return QObject::tr("desktop notifications");
case QWebEnginePage::Geolocation:
return QObject::tr("your position");
- case QWebEnginePage::MediaAudioDevices:
+ case QWebEnginePage::MediaAudioCapture:
return QObject::tr("your microphone");
- case QWebEnginePage::MediaVideoDevices:
+ case QWebEnginePage::MediaVideoCapture:
return QObject::tr("your camera");
- case QWebEnginePage::MediaAudioVideoDevices:
+ case QWebEnginePage::MediaAudioVideoCapture:
return QObject::tr("your camera and microphone");
default:
Q_UNREACHABLE();
diff --git a/examples/webenginewidgets/browser/settings.cpp b/examples/webenginewidgets/browser/settings.cpp
index d89c49353..835e7a9b5 100644
--- a/examples/webenginewidgets/browser/settings.cpp
+++ b/examples/webenginewidgets/browser/settings.cpp
@@ -95,7 +95,7 @@ void SettingsDialog::loadFromSettings()
{
QSettings settings;
settings.beginGroup(QLatin1String("MainWindow"));
- QString defaultHome = QLatin1String("http://qt-project.org/");
+ const QString defaultHome = QLatin1String(BrowserMainWindow::defaultHome);
homeLineEdit->setText(settings.value(QLatin1String("home"), defaultHome).toString());
settings.endGroup();
diff --git a/examples/webenginewidgets/browser/webview.cpp b/examples/webenginewidgets/browser/webview.cpp
index 5094cfa66..5ea273e3a 100644
--- a/examples/webenginewidgets/browser/webview.cpp
+++ b/examples/webenginewidgets/browser/webview.cpp
@@ -135,7 +135,10 @@ bool WebPage::certificateError(const QWebEngineCertificateError &error)
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setText(error.errorDescription());
- msgBox.setInformativeText(tr("If you wish so, you may continue with an unverified certicate. Accepting an unverified certicate means you may not be connected with the host you tried to connect to.\nDo you wish to override the security check and continue?"));
+ msgBox.setInformativeText(tr("If you wish so, you may continue with an unverified certificate. "
+ "Accepting an unverified certificate means "
+ "you may not be connected with the host you tried to connect to.\n"
+ "Do you wish to override the security check and continue?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::No);
return msgBox.exec() == QMessageBox::Yes;
diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp
index 3913b7548..44b6ca4ef 100644
--- a/src/core/browser_context_qt.cpp
+++ b/src/core/browser_context_qt.cpp
@@ -72,9 +72,21 @@ base::FilePath BrowserContextQt::GetPath() const
dataLocation = QDir::homePath() % QDir::separator() % QChar::fromLatin1('.') % QCoreApplication::applicationName();
dataLocation.append(QDir::separator() % QLatin1String("QtWebEngine"));
+ dataLocation.append(QDir::separator() % QLatin1String("Default"));
return base::FilePath(toFilePathString(dataLocation));
}
+base::FilePath BrowserContextQt::GetCachePath() const
+{
+ QString cacheLocation = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ if (cacheLocation.isEmpty())
+ cacheLocation = QDir::homePath() % QDir::separator() % QChar::fromLatin1('.') % QCoreApplication::applicationName();
+
+ cacheLocation.append(QDir::separator() % QLatin1String("QtWebEngine"));
+ cacheLocation.append(QDir::separator() % QLatin1String("Default"));
+ return base::FilePath(toFilePathString(cacheLocation));
+}
+
bool BrowserContextQt::IsOffTheRecord() const
{
return false;
@@ -133,7 +145,7 @@ content::PushMessagingService *BrowserContextQt::GetPushMessagingService()
net::URLRequestContextGetter *BrowserContextQt::CreateRequestContext(content::ProtocolHandlerMap *protocol_handlers)
{
- url_request_getter_ = new URLRequestContextGetterQt(GetPath(), protocol_handlers);
+ url_request_getter_ = new URLRequestContextGetterQt(GetPath(), GetCachePath(), protocol_handlers);
static_cast<ResourceContextQt*>(resourceContext.get())->set_url_request_context_getter(url_request_getter_.get());
return url_request_getter_.get();
}
diff --git a/src/core/browser_context_qt.h b/src/core/browser_context_qt.h
index 8c7e707a8..125c0fc46 100644
--- a/src/core/browser_context_qt.h
+++ b/src/core/browser_context_qt.h
@@ -51,6 +51,7 @@ public:
virtual ~BrowserContextQt();
virtual base::FilePath GetPath() const Q_DECL_OVERRIDE;
+ base::FilePath GetCachePath() const;
virtual bool IsOffTheRecord() const Q_DECL_OVERRIDE;
virtual net::URLRequestContextGetter *GetRequestContext() Q_DECL_OVERRIDE;
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index 8d44d0ad1..8ec600a85 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -69,9 +69,10 @@ static const char kQrcSchemeQt[] = "qrc";
using content::BrowserThread;
-URLRequestContextGetterQt::URLRequestContextGetterQt(const base::FilePath &basePath, content::ProtocolHandlerMap *protocolHandlers)
+URLRequestContextGetterQt::URLRequestContextGetterQt(const base::FilePath &dataPath, const base::FilePath &cachePath, content::ProtocolHandlerMap *protocolHandlers)
: m_ignoreCertificateErrors(false)
- , m_basePath(basePath)
+ , m_dataPath(dataPath)
+ , m_cachePath(cachePath)
{
std::swap(m_protocolHandlers, *protocolHandlers);
@@ -93,7 +94,7 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
m_urlRequestContext->set_network_delegate(m_networkDelegate.get());
- base::FilePath cookiesPath = m_basePath.Append(FILE_PATH_LITERAL("Cookies"));
+ base::FilePath cookiesPath = m_dataPath.Append(FILE_PATH_LITERAL("Cookies"));
content::CookieStoreConfig cookieStoreConfig(cookiesPath, content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES, NULL, NULL);
scoped_refptr<net::CookieStore> cookieStore = content::CreateCookieStore(cookieStoreConfig);
@@ -119,7 +120,7 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
m_storage->set_http_server_properties(scoped_ptr<net::HttpServerProperties>(new net::HttpServerPropertiesImpl));
- base::FilePath cache_path = m_basePath.Append(FILE_PATH_LITERAL("Cache"));
+ base::FilePath cache_path = m_cachePath.Append(FILE_PATH_LITERAL("Cache"));
net::HttpCache::DefaultBackend* main_backend =
new net::HttpCache::DefaultBackend(
net::DISK_CACHE,
diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h
index 50335291e..6c9ac6d59 100644
--- a/src/core/url_request_context_getter_qt.h
+++ b/src/core/url_request_context_getter_qt.h
@@ -58,7 +58,7 @@ class ProxyConfigService;
class URLRequestContextGetterQt : public net::URLRequestContextGetter {
public:
- explicit URLRequestContextGetterQt(const base::FilePath &, content::ProtocolHandlerMap *protocolHandlers);
+ explicit URLRequestContextGetterQt(const base::FilePath &, const base::FilePath &, content::ProtocolHandlerMap *protocolHandlers);
virtual net::URLRequestContext *GetURLRequestContext() Q_DECL_OVERRIDE;
virtual scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const Q_DECL_OVERRIDE;
@@ -67,7 +67,8 @@ private:
virtual ~URLRequestContextGetterQt() {}
bool m_ignoreCertificateErrors;
- base::FilePath m_basePath;
+ base::FilePath m_dataPath;
+ base::FilePath m_cachePath;
content::ProtocolHandlerMap m_protocolHandlers;
scoped_ptr<net::ProxyConfigService> m_proxyConfigService;
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index d6782974b..72b16f28b 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -332,11 +332,11 @@ void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &security
Q_Q(QWebEnginePage);
QWebEnginePage::Feature requestedFeature;
if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture) && requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
- requestedFeature = QWebEnginePage::MediaAudioVideoDevices;
+ requestedFeature = QWebEnginePage::MediaAudioVideoCapture;
else if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture))
- requestedFeature = QWebEnginePage::MediaAudioDevices;
+ requestedFeature = QWebEnginePage::MediaAudioCapture;
else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
- requestedFeature = QWebEnginePage::MediaVideoDevices;
+ requestedFeature = QWebEnginePage::MediaVideoCapture;
else
return;
Q_EMIT q->featurePermissionRequested(securityOrigin, requestedFeature);
@@ -745,16 +745,16 @@ void QWebEnginePage::setFeaturePermission(const QUrl &securityOrigin, QWebEngine
Q_D(QWebEnginePage);
WebContentsAdapterClient::MediaRequestFlags flags = WebContentsAdapterClient::MediaNone;
switch (feature) {
- case MediaAudioVideoDevices:
- case MediaAudioDevices:
- case MediaVideoDevices:
+ case MediaAudioVideoCapture:
+ case MediaAudioCapture:
+ case MediaVideoCapture:
if (policy != PermissionUnknown) {
if (policy == PermissionDeniedByUser)
flags = WebContentsAdapterClient::MediaNone;
else {
- if (feature == MediaAudioDevices)
+ if (feature == MediaAudioCapture)
flags = WebContentsAdapterClient::MediaAudioCapture;
- else if (feature == MediaVideoDevices)
+ else if (feature == MediaVideoCapture)
flags = WebContentsAdapterClient::MediaVideoCapture;
else
flags = WebContentsAdapterClient::MediaRequestFlags(WebContentsAdapterClient::MediaVideoCapture | WebContentsAdapterClient::MediaAudioCapture);
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index cda6e620f..7856b8243 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -122,7 +122,8 @@ public:
FindBackward = 1,
FindCaseSensitively = 2,
};
- Q_DECLARE_FLAGS(FindFlags, FindFlag)
+ Q_DECLARE_FLAGS(FindFlags, FindFlag);
+
enum WebWindowType {
WebBrowserWindow,
WebBrowserTab,
@@ -136,12 +137,15 @@ public:
};
enum Feature {
- Notifications,
- Geolocation,
- MediaAudioDevices,
- MediaVideoDevices,
- MediaAudioVideoDevices
+#ifndef Q_QDOC
+ Notifications = 0,
+ Geolocation = 1,
+#endif
+ MediaAudioCapture = 2,
+ MediaVideoCapture,
+ MediaAudioVideoCapture
};
+
// Ex-QWebFrame enum
enum FileSelectionMode {
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 983b80d7e..e89b10ab8 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -151,11 +151,9 @@
This enum describes the platform feature access categories that the user may be asked to grant or deny access to.
- \value Notifications Grants access to display notifications to the user.
- \value Geolocation The geographic location devices that may be available.
- \value MediaAudioDevices Audio devices such as speakers or microphones
- \value MediaVideoDevices Video devices, e.g. cameras
- \value MediaAudioVideoDevices Both Audio and Video devices.
+ \value MediaAudioCapture Audio capture devices such a microphones
+ \value MediaVideoCapture Video devices, e.g. cameras
+ \value MediaAudioVideoCapture Both Audio and Video capture devices.
\sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), PermissionPolicy
diff --git a/tests/quicktestbrowser/quickwindow.qml b/tests/quicktestbrowser/quickwindow.qml
index f24717b01..6a5ef3187 100644
--- a/tests/quicktestbrowser/quickwindow.qml
+++ b/tests/quicktestbrowser/quickwindow.qml
@@ -70,6 +70,7 @@ ApplicationWindow {
Settings {
property alias autoLoadImages: loadImages.checked;
property alias javaScriptEnabled: javaScriptEnabled.checked;
+ property alias errorPageEnabled: errorPageEnabled.checked;
}
// Make sure the Qt.WindowFullscreenButtonHint is set on Mac.
@@ -215,6 +216,13 @@ ApplicationWindow {
checked: WebEngine.settings.javascriptEnabled
onCheckedChanged: WebEngine.settings.javascriptEnabled = checked
}
+ MenuItem {
+ id: errorPageEnabled
+ text: "ErrorPage On"
+ checkable: true
+ checked: WebEngine.settings.errorPageEnabled
+ onCheckedChanged: WebEngine.settings.errorPageEnabled = checked
+ }
}
}
}