summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-01-25 17:15:22 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-01-25 17:15:22 +0000
commit818da2a36e96f8d815439c6805b74f4d35176d5a (patch)
tree77f432785f08ad0ee544c88e0e40d3e30daac0df /src
parent728d271a4786008dc56980ccb47cc8901f468b55 (diff)
parentacf7f38b2b4a5d6427dca9b6538e3394cfde2d94 (diff)
Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/dev
Diffstat (limited to 'src')
-rw-r--r--src/core/qtwebengine.gypi5
-rw-r--r--src/core/render_widget_host_view_qt.cpp8
-rw-r--r--src/core/render_widget_host_view_qt_delegate.h1
-rw-r--r--src/core/web_contents_adapter.cpp21
-rw-r--r--src/core/web_contents_adapter.h2
-rw-r--r--src/core/web_contents_adapter_p.h3
-rw-r--r--src/core/web_contents_view_qt.cpp13
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc15
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.h1
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.h1
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp5
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h1
12 files changed, 50 insertions, 26 deletions
diff --git a/src/core/qtwebengine.gypi b/src/core/qtwebengine.gypi
index 5131ce8cc..b83b1cbfa 100644
--- a/src/core/qtwebengine.gypi
+++ b/src/core/qtwebengine.gypi
@@ -5,6 +5,11 @@
'variables': {
'version_script_location%': '<(chromium_src_dir)/build/util/version.py',
},
+ 'configurations': {
+ 'Release': {
+ 'defines': [ 'QT_NO_DEBUG' ],
+ },
+ },
'dependencies': [
'<(chromium_src_dir)/base/base.gyp:base',
'<(chromium_src_dir)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index fef3831e3..0d153dec2 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -116,7 +116,7 @@ static inline Qt::InputMethodHints toQtInputMethodHints(ui::TextInputType inputT
case ui::TEXT_INPUT_TYPE_SEARCH:
return Qt::ImhPreferLowercase | Qt::ImhNoAutoUppercase;
case ui::TEXT_INPUT_TYPE_PASSWORD:
- return Qt::ImhSensitiveData | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase;
+ return Qt::ImhSensitiveData | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase | Qt::ImhHiddenText;
case ui::TEXT_INPUT_TYPE_EMAIL:
return Qt::ImhEmailCharactersOnly;
case ui::TEXT_INPUT_TYPE_NUMBER:
@@ -575,6 +575,7 @@ void RenderWidgetHostViewQt::TextInputStateChanged(const content::TextInputState
{
m_currentInputType = params.type;
m_delegate->inputMethodStateChanged(params.type != ui::TEXT_INPUT_TYPE_NONE);
+ m_delegate->setInputMethodHints(toQtInputMethodHints(params.type));
}
void RenderWidgetHostViewQt::ImeCancelComposition()
@@ -1115,7 +1116,10 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev)
QGuiApplication::postEvent(qApp->focusObject(), eventCopy);
} else {
m_receivedEmptyImeText = false;
- m_host->ImeCancelComposition();
+ if (m_imeInProgress) {
+ m_imeInProgress = false;
+ m_host->ImeCancelComposition();
+ }
}
}
}
diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h
index 1e50c8f08..1e1234e72 100644
--- a/src/core/render_widget_host_view_qt_delegate.h
+++ b/src/core/render_widget_host_view_qt_delegate.h
@@ -112,6 +112,7 @@ public:
virtual void resize(int width, int height) = 0;
virtual void move(const QPoint &) = 0;
virtual void inputMethodStateChanged(bool editorVisible) = 0;
+ virtual void setInputMethodHints(Qt::InputMethodHints hints) = 0;
virtual void setClearColor(const QColor &color) = 0;
};
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 9de2085ba..3763770d9 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -348,7 +348,7 @@ WebContentsAdapterPrivate::WebContentsAdapterPrivate()
, adapterClient(0)
, nextRequestId(CallbackDirectory::ReservedCallbackIdsEnd)
, lastFindRequestId(0)
- , currentDropAction(Qt::IgnoreAction)
+ , currentDropAction(blink::WebDragOperationNone)
, inDragUpdateLoop(false)
, updateDragCursorMessagePollingTimer(new QTimer)
{
@@ -1169,7 +1169,7 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
d->currentDropData->file_contents.clear();
d->currentDropData->file_description_filename.clear();
- d->currentDropAction = Qt::IgnoreAction;
+ d->currentDropAction = blink::WebDragOperationNone;
QDrag *drag = new QDrag(dragSource); // will be deleted by Qt's DnD implementation
bool dValid = true;
QMetaObject::Connection onDestroyed = QObject::connect(dragSource, &QObject::destroyed, [&dValid](){
@@ -1246,6 +1246,17 @@ void WebContentsAdapter::enterDrag(QDragEnterEvent *e, const QPoint &screenPos)
flagsFromModifiers(e->keyboardModifiers()));
}
+Qt::DropAction toQt(blink::WebDragOperation op)
+{
+ if (op & blink::WebDragOperationCopy)
+ return Qt::CopyAction;
+ if (op & blink::WebDragOperationLink)
+ return Qt::LinkAction;
+ if (op & blink::WebDragOperationMove || op & blink::WebDragOperationDelete)
+ return Qt::MoveAction;
+ return Qt::IgnoreAction;
+}
+
Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const QPoint &screenPos)
{
Q_D(WebContentsAdapter);
@@ -1273,13 +1284,13 @@ Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const Q
loop.Run();
d->updateDragCursorMessagePollingTimer->stop();
- return d->currentDropAction;
+ return toQt(d->currentDropAction);
}
-void WebContentsAdapter::updateDragAction(Qt::DropAction action)
+void WebContentsAdapter::updateDragAction(int action)
{
Q_D(WebContentsAdapter);
- d->currentDropAction = action;
+ d->currentDropAction = static_cast<blink::WebDragOperation>(action);
finishDragUpdate();
}
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h
index cb7f9b461..0accd3be5 100644
--- a/src/core/web_contents_adapter.h
+++ b/src/core/web_contents_adapter.h
@@ -168,7 +168,7 @@ public:
Qt::DropActions allowedActions, const QPixmap &pixmap, const QPoint &offset);
void enterDrag(QDragEnterEvent *e, const QPoint &screenPos);
Qt::DropAction updateDragPosition(QDragMoveEvent *e, const QPoint &screenPos);
- void updateDragAction(Qt::DropAction action);
+ void updateDragAction(int action);
void finishDragUpdate();
void endDragging(const QPoint &clientPos, const QPoint &screenPos);
void leaveDrag();
diff --git a/src/core/web_contents_adapter_p.h b/src/core/web_contents_adapter_p.h
index 23a1aaef4..2d8490c7b 100644
--- a/src/core/web_contents_adapter_p.h
+++ b/src/core/web_contents_adapter_p.h
@@ -55,6 +55,7 @@
#include <base/callback.h>
#include "base/memory/ref_counted.h"
+#include <third_party/WebKit/public/platform/WebDragOperation.h>
#include <QScopedPointer>
#include <QSharedPointer>
@@ -93,7 +94,7 @@ public:
quint64 nextRequestId;
int lastFindRequestId;
std::unique_ptr<content::DropData> currentDropData;
- Qt::DropAction currentDropAction;
+ blink::WebDragOperation currentDropAction;
bool inDragUpdateLoop;
base::Closure dragUpdateLoopQuitClosure;
QScopedPointer<QTimer> updateDragCursorMessagePollingTimer;
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 0c4cf29d3..24c4e198f 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -203,17 +203,6 @@ Qt::DropActions toQtDropActions(blink::WebDragOperationsMask ops)
return result;
}
-Qt::DropAction toQt(blink::WebDragOperation op)
-{
- if (op == blink::WebDragOperationCopy)
- return Qt::CopyAction;
- if (op == blink::WebDragOperationLink)
- return Qt::LinkAction;
- if (op == blink::WebDragOperationMove || op == blink::WebDragOperationDelete)
- return Qt::MoveAction;
- return Qt::IgnoreAction;
-}
-
void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
blink::WebDragOperationsMask allowed_ops,
const gfx::ImageSkia &image,
@@ -235,7 +224,7 @@ void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
void WebContentsViewQt::UpdateDragCursor(blink::WebDragOperation dragOperation)
{
- m_client->webContentsAdapter()->updateDragAction(toQt(dragOperation));
+ m_client->webContentsAdapter()->updateDragAction(dragOperation);
}
void WebContentsViewQt::TakeFocus(bool reverse)
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index c3d737384..ff35b45cf 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -197,11 +197,16 @@
\section1 Proxy Support
- Qt WebEngine uses the proxy settings from \l{Qt Network}. If
- QNetworkProxy::applicationProxy is set, it will also be used for Qt WebEngine, and if
- QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings are automatically
- retrieved from the system. Settings from an installed QNetworkProxyFactory will be ignored
- though.
+ Qt WebEngine uses the proxy settings from \l{Qt Network}, and forwards them to Chromium's
+ networking stack. If QNetworkProxy::applicationProxy is set, it will also be used for Qt
+ WebEngine. If QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings
+ are automatically retrieved from the system. Settings from an installed QNetworkProxyFactory
+ will be ignored, though.
+
+ Not all properties of QNetworkProxy are supported by Qt WebEngine. That is,
+ QNetworkProxy::type(), QNetworkProxy::hostName() and QNetworkProxy::port() are taken into
+ account. All other proxy settings such as QNetworkProxy::rawHeader(), QNetworkProxy::user(), or
+ QNetworkProxy::password() are ignored.
If a proxy requires authentication, QWebEnginePage::proxyAuthenticationRequired is emitted.
For Qt Quick, a dialog is shown.
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h
index 385a98a3c..7a08e915b 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h
@@ -74,6 +74,7 @@ public:
virtual void resize(int width, int height) Q_DECL_OVERRIDE;
virtual void move(const QPoint&) Q_DECL_OVERRIDE { }
virtual void inputMethodStateChanged(bool editorVisible) Q_DECL_OVERRIDE;
+ virtual void setInputMethodHints(Qt::InputMethodHints) Q_DECL_OVERRIDE { }
// The QtQuick view doesn't have a backbuffer of its own and doesn't need this
virtual void setClearColor(const QColor &) Q_DECL_OVERRIDE { }
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
index d0a5e480c..057b91c75 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
@@ -77,6 +77,7 @@ public:
virtual void resize(int width, int height) Q_DECL_OVERRIDE;
virtual void move(const QPoint &screenPos) Q_DECL_OVERRIDE;
virtual void inputMethodStateChanged(bool) Q_DECL_OVERRIDE {}
+ virtual void setInputMethodHints(Qt::InputMethodHints) Q_DECL_OVERRIDE { }
virtual void setClearColor(const QColor &) Q_DECL_OVERRIDE { }
private:
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
index 27268d26b..69ecbe160 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -323,6 +323,11 @@ void RenderWidgetHostViewQtDelegateWidget::inputMethodStateChanged(bool editorVi
qApp->inputMethod()->setVisible(editorVisible);
}
+void RenderWidgetHostViewQtDelegateWidget::setInputMethodHints(Qt::InputMethodHints hints)
+{
+ QQuickWidget::setInputMethodHints(hints);
+}
+
void RenderWidgetHostViewQtDelegateWidget::setClearColor(const QColor &color)
{
QQuickWidget::setClearColor(color);
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
index 68e6a176b..fb33c55c7 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
@@ -75,6 +75,7 @@ public:
virtual void resize(int width, int height) Q_DECL_OVERRIDE;
virtual void move(const QPoint &screenPos) Q_DECL_OVERRIDE;
virtual void inputMethodStateChanged(bool editorVisible) Q_DECL_OVERRIDE;
+ virtual void setInputMethodHints(Qt::InputMethodHints) Q_DECL_OVERRIDE;
virtual void setClearColor(const QColor &color) Q_DECL_OVERRIDE;
protected: