| Index: webkit/glue/webview_impl.cc
|
| ===================================================================
|
| --- webkit/glue/webview_impl.cc (revision 21785)
|
| +++ webkit/glue/webview_impl.cc (working copy)
|
| @@ -52,6 +52,7 @@
|
| #include "GraphicsContext.h"
|
| #include "HTMLNames.h"
|
| #include "HTMLInputElement.h"
|
| +#include "HTMLMediaElement.h"
|
| #include "HitTestResult.h"
|
| #include "Image.h"
|
| #include "InspectorController.h"
|
| @@ -1796,6 +1797,41 @@
|
| 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_;
|
|
|
| Property changes on: webkit\glue\webview_impl.cc
|
| ___________________________________________________________________
|
| Modified: svn:mergeinfo
|
| Merged /trunk/src/webkit/glue/webview_impl.cc:r21466
|
|
|
|
|