diff options
author | Liang Qi <liang.qi@qt.io> | 2017-03-10 11:26:09 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-03-10 11:26:09 +0100 |
commit | 40cc6dea5b1b5d2570468adcc83943f8c8bd112e (patch) | |
tree | a314707e11905a9f8bab8d6a93d4532194af371a /Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp | |
parent | 0b30e4490f7500ade1868fb33cea8705418c90bb (diff) | |
parent | c176f1fbe8ed0d87c507811f4c0e4d67a71bc890 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
.qmake.conf
Change-Id: Id65b546f295897cd386125d2d3d4160051cc7d22
Diffstat (limited to 'Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp')
-rw-r--r-- | Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp index 554ab8927..a4e1f7464 100644 --- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp +++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp @@ -874,8 +874,11 @@ void QWebPageAdapter::dynamicPropertyChangeEvent(QObject* obj, QDynamicPropertyC #define MAP_ACTION_FROM_VALUE(Name, Value) \ case Value: return QWebPageAdapter::Name -static QWebPageAdapter::MenuAction adapterActionForContextMenuAction(WebCore::ContextMenuAction action) +static int adapterActionForContextMenuAction(WebCore::ContextMenuAction action) { + if (action >= ContextMenuItemBaseCustomTag && action <= ContextMenuItemLastCustomTag) + return action; + switch (action) { FOR_EACH_MAPPED_MENU_ACTION(MAP_ACTION_FROM_VALUE, SEMICOLON_SEPARATOR); #if ENABLE(INSPECTOR) @@ -899,7 +902,7 @@ QList<MenuItem> descriptionForPlatformMenu(const Vector<ContextMenuItem>& items, switch (item.type()) { case WebCore::CheckableActionType: /* fall through */ case WebCore::ActionType: { - QWebPageAdapter::MenuAction action = adapterActionForContextMenuAction(item.action()); + int action = adapterActionForContextMenuAction(item.action()); if (action > QWebPageAdapter::NoAction) { description.type = MenuItem::Action; description.action = action; @@ -1207,6 +1210,16 @@ void QWebPageAdapter::triggerAction(QWebPageAdapter::MenuAction action, QWebHitT } } +void QWebPageAdapter::triggerCustomAction(int action, const QString &title) +{ + if (action >= ContextMenuItemBaseCustomTag && action <= ContextMenuItemLastCustomTag) { + ContextMenuItem item(ActionType, static_cast<ContextMenuAction>(action), title); + page->contextMenuController()->contextMenuItemSelected(&item); + } else { + ASSERT_NOT_REACHED(); + } +} + QString QWebPageAdapter::contextMenuItemTagForAction(QWebPageAdapter::MenuAction action, bool* checkable) const { |