Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Unified Diff: webkit/api/src/WebMediaPlayerClientImpl.cpp

Issue 350003: Flesh out more of ChromiumBridge.cpp eliminating all but two methods on... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/api/src/TemporaryGlue.h ('k') | webkit/api/src/WebPluginContainerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/WebMediaPlayerClientImpl.cpp
===================================================================
--- webkit/api/src/WebMediaPlayerClientImpl.cpp (revision 30581)
+++ webkit/api/src/WebMediaPlayerClientImpl.cpp (working copy)
@@ -7,9 +7,10 @@
#if ENABLE(VIDEO)
-#include "TimeRanges.h"
#include "WebCanvas.h"
#include "WebCString.h"
+#include "WebFrameClient.h"
+#include "WebFrameImpl.h"
#include "WebKit.h"
#include "WebKitClient.h"
#include "WebMediaPlayer.h"
@@ -27,6 +28,7 @@
#include "KURL.h"
#include "MediaPlayer.h"
#include "NotImplemented.h"
+#include "TimeRanges.h"
#include <wtf/Assertions.h>
#if WEBKIT_USING_SKIA
@@ -37,6 +39,15 @@
namespace WebKit {
+static WebMediaPlayer* createWebMediaPlayer(
+ WebMediaPlayerClient* client, Frame* frame)
+{
+ WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
+ if (!webFrame->client())
+ return 0;
+ return webFrame->client()->createMediaPlayer(webFrame, client);
+}
+
bool WebMediaPlayerClientImpl::m_isEnabled = false;
bool WebMediaPlayerClientImpl::isEnabled()
@@ -58,7 +69,6 @@
}
}
-
// WebMediaPlayerClient --------------------------------------------------------
void WebMediaPlayerClientImpl::networkStateChanged()
@@ -121,7 +131,7 @@
{
Frame* frame = static_cast<HTMLMediaElement*>(
m_mediaPlayer->mediaPlayerClient())->document()->frame();
- m_webMediaPlayer.set(webKitClient()->createWebMediaPlayer(this, frame));
+ m_webMediaPlayer.set(createWebMediaPlayer(this, frame));
if (m_webMediaPlayer.get())
m_webMediaPlayer->load(KURL(ParsedURLString, url));
}
@@ -258,13 +268,13 @@
return 0.0f;
}
-WTF::PassRefPtr<WebCore::TimeRanges> WebMediaPlayerClientImpl::buffered() const
+PassRefPtr<TimeRanges> WebMediaPlayerClientImpl::buffered() const
{
if (m_webMediaPlayer.get()) {
const WebTimeRanges& webRanges = m_webMediaPlayer->buffered();
// FIXME: Save the time ranges in a member variable and update it when needed.
- WTF::RefPtr<TimeRanges> ranges = TimeRanges::create();
+ RefPtr<TimeRanges> ranges = TimeRanges::create();
for (size_t i = 0; i < webRanges.size(); ++i)
ranges->add(webRanges[i].start, webRanges[i].end);
return ranges.release();
« no previous file with comments | « webkit/api/src/TemporaryGlue.h ('k') | webkit/api/src/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698