Source

Target

Commits (14)
Showing with 179 additions and 24 deletions
......@@ -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
......
......@@ -66,7 +66,7 @@ QUrl startupUrl()
if (ret.isValid())
return ret;
}
return QUrl(QStringLiteral("http://qt-project.org/"));
return QUrl(QStringLiteral("http://qt.io/"));
}
......
......@@ -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);
}
......
......@@ -70,6 +70,8 @@ public:
~BrowserMainWindow();
QSize sizeHint() const;
static const char *defaultHome;
public:
TabWidget *tabWidget() const;
WebView *currentTab() const;
......
......@@ -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>
......
......@@ -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();
......
......@@ -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();
......
......@@ -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;
......
Subproject commit 0dcd4e35086a90f643bb721fad1ef786f5fff8ba
Subproject commit 577cd47e54bb88c81b7a5b5a6d658d8d61b2c747
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "access_token_store_qt.h"
#include <QDebug>
AccessTokenStoreQt::AccessTokenStoreQt()
{
}
AccessTokenStoreQt::~AccessTokenStoreQt()
{
}
void AccessTokenStoreQt::LoadAccessTokens(const LoadAccessTokensCallbackType& callback)
{
}
void AccessTokenStoreQt::SaveAccessToken(const GURL& server_url, const base::string16& access_token)
{
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ACCESS_TOKEN_STORE_QT_H
#define ACCESS_TOKEN_STORE_QT_H
#include "content/public/browser/access_token_store.h"
#include <QtCore/qcompilerdetection.h> // Needed for Q_DECL_OVERRIDE
class AccessTokenStoreQt : public content::AccessTokenStore
{
public:
AccessTokenStoreQt();
~AccessTokenStoreQt();
virtual void LoadAccessTokens(const LoadAccessTokensCallbackType& callback) Q_DECL_OVERRIDE;
virtual void SaveAccessToken(const GURL& server_url, const base::string16& access_token) Q_DECL_OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(AccessTokenStoreQt);
};
#endif // ACCESS_TOKEN_STORE_QT_H
......@@ -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();
}
......@@ -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;
......
......@@ -62,6 +62,7 @@
#include "media_capture_devices_dispatcher.h"
#include "resource_dispatcher_host_delegate_qt.h"
#include "web_contents_delegate_qt.h"
#include "access_token_store_qt.h"
#include <QGuiApplication>
#include <QOpenGLContext>
......@@ -347,6 +348,11 @@ void ContentBrowserClientQt::OverrideWebkitPrefs(content::RenderViewHost *rvh, c
static_cast<WebContentsDelegateQt*>(webContents->GetDelegate())->overrideWebPreferences(webContents, web_prefs);
}
content::AccessTokenStore *ContentBrowserClientQt::CreateAccessTokenStore()
{
return new AccessTokenStoreQt;
}
BrowserContextQt* ContentBrowserClientQt::browser_context() {
Q_ASSERT(m_browserMainParts);
return static_cast<BrowserMainPartsQt*>(m_browserMainParts)->browser_context();
......
......@@ -79,6 +79,7 @@ public:
virtual gfx::GLShareGroup* GetInProcessGpuShareGroup() Q_DECL_OVERRIDE;
virtual content::MediaObserver* GetMediaObserver() Q_DECL_OVERRIDE;
virtual void OverrideWebkitPrefs(content::RenderViewHost *, const GURL &, WebPreferences *) Q_DECL_OVERRIDE;
virtual content::AccessTokenStore *CreateAccessTokenStore() Q_DECL_OVERRIDE;
virtual void AllowCertificateError(
int render_process_id,
int render_frame_id,
......
......@@ -33,6 +33,7 @@ RESOURCES += devtools.qrc
INCLUDEPATH += $$[QT_INSTALL_HEADERS] $$PWD
SOURCES = \
access_token_store_qt.cpp \
browser_accessibility_manager_qt.cpp \
browser_accessibility_qt.cpp \
browser_context_qt.cpp \
......@@ -80,6 +81,7 @@ SOURCES = \
yuv_video_node.cpp
HEADERS = \
access_token_store_qt.h \
browser_accessibility_manager_qt.h \
browser_accessibility_qt.h \
browser_context_qt.h \
......
......@@ -133,6 +133,12 @@ static inline ui::GestureProvider::Config QtGestureProviderConfig() {
return config;
}
static inline bool compareTouchPoints(const QTouchEvent::TouchPoint &lhs, const QTouchEvent::TouchPoint &rhs)
{
// TouchPointPressed < TouchPointMoved < TouchPointReleased
return lhs.state() < rhs.state();
}
class MotionEventQt : public ui::MotionEvent {
public:
MotionEventQt(const QList<QTouchEvent::TouchPoint> &touchPoints, const base::TimeTicks &eventTime, Action action, int index = -1)
......@@ -983,6 +989,10 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev)
if (ev->type() == QEvent::TouchBegin)
m_sendMotionActionDown = true;
// Make sure that ACTION_POINTER_DOWN is delivered before ACTION_MOVE,
// and ACTION_MOVE before ACTION_POINTER_UP.
std::sort(touchPoints.begin(), touchPoints.end(), compareTouchPoints);
for (int i = 0; i < touchPoints.size(); ++i) {
ui::MotionEvent::Action action;
switch (touchPoints[i].state()) {
......
......@@ -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,
......
......@@ -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;
......
......@@ -142,7 +142,11 @@ WebEngineContext::WebEngineContext()
#if defined(OS_WIN)
parsedCommandLine->AppendSwitch(switches::kDisableD3D11);
// ANGLE doesn't support multi-threading, doing texture upload from the GPU thread
// hasn't been causing problems yet but doing rendering there is conflicting with
// Qt's rendering of the scene graph.
parsedCommandLine->AppendSwitch(switches::kDisableExperimentalWebGL);
parsedCommandLine->AppendSwitch(switches::kDisableAccelerated2dCanvas);
#endif
#if defined(QTWEBENGINE_MOBILE_SWITCHES)
......