summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-08 16:05:17 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-11 12:58:16 +0000
commit4d4fa829cd3ebeb284e691d7d928b67366f3cbf0 (patch)
treeaed1caf99dd5a3859f2922f3994a24a70a02a118 /src/core/web_contents_adapter.cpp
parent18cc8aa2893e62f2b2679e67ed4747243e25da35 (diff)
Extend context menu actions
Implements the several missing context menu actions for navigation and image and media handling. Change-Id: Ib8ea8311ea291fe2f98e509bc6f4034a5e0389c9 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index f0b0a0d94..ec7928c71 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -758,6 +758,25 @@ void WebContentsAdapter::updateWebPreferences(const content::WebPreferences & we
d->webContents->GetRenderViewHost()->UpdateWebkitPreferences(webPreferences);
}
+void WebContentsAdapter::copyImageAt(const QPoint &location)
+{
+ Q_D(WebContentsAdapter);
+ d->webContents->GetRenderViewHost()->CopyImageAt(location.x(), location.y());
+}
+
+ASSERT_ENUMS_MATCH(WebContentsAdapter::MediaPlayerNoAction, blink::WebMediaPlayerAction::Unknown)
+ASSERT_ENUMS_MATCH(WebContentsAdapter::MediaPlayerPlay, blink::WebMediaPlayerAction::Play)
+ASSERT_ENUMS_MATCH(WebContentsAdapter::MediaPlayerMute, blink::WebMediaPlayerAction::Mute)
+ASSERT_ENUMS_MATCH(WebContentsAdapter::MediaPlayerLoop, blink::WebMediaPlayerAction::Loop)
+ASSERT_ENUMS_MATCH(WebContentsAdapter::MediaPlayerControls, blink::WebMediaPlayerAction::Controls)
+
+void WebContentsAdapter::executeMediaPlayerActionAt(const QPoint &location, MediaPlayerAction action, bool enable)
+{
+ Q_D(WebContentsAdapter);
+ blink::WebMediaPlayerAction blinkAction((blink::WebMediaPlayerAction::Type)action, enable);
+ d->webContents->GetRenderViewHost()->ExecuteMediaPlayerActionAtLocation(toGfx(location), blinkAction);
+}
+
void WebContentsAdapter::wasShown()
{
Q_D(WebContentsAdapter);