From 3bc49c8c3d13a6745cc535c7e6a57da60bb83a09 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Tue, 23 Mar 2010 10:17:19 +0000 Subject: Only replaced flash content if youtube app is installed. Fix for bug 2521517. Change-Id: Id1b2401728d03410a10bac6674450f5123b4785e --- WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index 10cd0b3..6e42d47 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -46,6 +46,7 @@ #include "IconDatabase.h" #include "MIMETypeRegistry.h" #include "NotImplemented.h" +#include "PackageNotifier.h" #include "Page.h" #include "PlatformBridge.h" #include "PlatformGraphicsContext.h" @@ -995,6 +996,10 @@ static bool isYouTubeUrl(const KURL& url, const String& mimeType) && equalIgnoringCase(mimeType, "application/x-shockwave-flash"); } +static bool isYouTubeInstalled() { + return WebCore::packageNotifier().isPackageInstalled("com.google.android.youtube"); +} + WTF::PassRefPtr FrameLoaderClientAndroid::createPlugin( const IntSize& size, HTMLPlugInElement* element, @@ -1004,7 +1009,7 @@ WTF::PassRefPtr FrameLoaderClientAndroid::createPlugin( const String& mimeType, bool loadManually) { // Create an iframe for youtube urls. - if (isYouTubeUrl(url, mimeType)) { + if (isYouTubeUrl(url, mimeType) && isYouTubeInstalled()) { WTF::RefPtr frame = createFrame(blankURL(), String(), element, String(), false, 0, 0); if (frame) { -- cgit v1.1