| Index: webkit/glue/webview_impl.cc
|
| diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
|
| index 29152bdc2baaaf7572590ffae6bcf58c0ee6828a..a4ceff087591f75358d413faf963375cbd8d9ef3 100644
|
| --- a/webkit/glue/webview_impl.cc
|
| +++ b/webkit/glue/webview_impl.cc
|
| @@ -52,6 +52,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
|
| #include "GraphicsContext.h"
|
| #include "HTMLNames.h"
|
| #include "HTMLInputElement.h"
|
| +#include "HTMLMediaElement.h"
|
| #include "HitTestResult.h"
|
| #include "Image.h"
|
| #include "InspectorController.h"
|
| @@ -1791,6 +1792,41 @@ bool WebViewImpl::GetIsTransparent() const {
|
| return is_transparent_;
|
| }
|
|
|
| +void WebViewImpl::MediaPlayerActionAt(int x,
|
| + int y,
|
| + const MediaPlayerAction& action) {
|
| + HitTestResult result = HitTestResultForWindowPos(IntPoint(x, y));
|
| +
|
| + WTF::RefPtr<WebCore::Node> node = result.innerNonSharedNode();
|
| + if (node->hasTagName(WebCore::HTMLNames::videoTag) ||
|
| + node->hasTagName(WebCore::HTMLNames::audioTag)) {
|
| + WTF::RefPtr<WebCore::HTMLMediaElement> media_element =
|
| + static_pointer_cast<WebCore::HTMLMediaElement>(node);
|
| + if (action.command & MediaPlayerAction::PLAY) {
|
| + media_element->play();
|
| + }
|
| + if (action.command & MediaPlayerAction::PAUSE) {
|
| + media_element->pause();
|
| + }
|
| + if (action.command & MediaPlayerAction::MUTE) {
|
| + media_element->setMuted(true);
|
| + }
|
| + if (action.command & MediaPlayerAction::UNMUTE) {
|
| + media_element->setMuted(false);
|
| + }
|
| + if (action.command & MediaPlayerAction::LOOP) {
|
| + media_element->setLoop(true);
|
| + }
|
| + if (action.command & MediaPlayerAction::NO_LOOP) {
|
| + media_element->setLoop(false);
|
| + }
|
| + if (action.command & MediaPlayerAction::SET_PLAYBACK_RATE) {
|
| + // TODO(ajwong): We should test for overflow.
|
| + media_element->setPlaybackRate(static_cast<float>(action.playback_rate));
|
| + }
|
| + }
|
| +}
|
| +
|
| void WebViewImpl::DidCommitLoad(bool* is_new_navigation) {
|
| if (is_new_navigation)
|
| *is_new_navigation = observed_new_navigation_;
|
|
|