Index: components/plugins/renderer/mobile_youtube_plugin.cc |
diff --git a/components/plugins/renderer/mobile_youtube_plugin.cc b/components/plugins/renderer/mobile_youtube_plugin.cc |
index e2f5793e790e4dc55fcd2331828186d90964178a..b65c7e45afa0a66fffde0b48e5f8a26a36a1059c 100644 |
--- a/components/plugins/renderer/mobile_youtube_plugin.cc |
+++ b/components/plugins/renderer/mobile_youtube_plugin.cc |
@@ -79,7 +79,9 @@ MobileYouTubePlugin::MobileYouTubePlugin(content::RenderView* render_view, |
frame, |
params, |
HtmlData(params, template_html), |
- placeholderDataUrl) {} |
+ placeholderDataUrl) { |
+ RegisterCallback("openYoutubeURL"); |
+} |
// static |
bool MobileYouTubePlugin::IsYouTubeURL(const GURL& url, |
@@ -92,9 +94,9 @@ bool MobileYouTubePlugin::IsYouTubeURL(const GURL& url, |
LowerCaseEqualsASCII(mime_type, content::kFlashPluginSwfMimeType); |
} |
-void MobileYouTubePlugin::OpenYoutubeUrlCallback( |
- const webkit_glue::CppArgumentList& args, |
- webkit_glue::CppVariant* result) { |
+void MobileYouTubePlugin::Observe(const std::string& callback) { |
+ DCHECK_EQ("openYoutubeURL", callback); |
+ |
std::string youtube("vnd.youtube:"); |
GURL url(youtube.append(GetYoutubeVideoId(GetPluginParams()))); |
WebURLRequest request; |
@@ -103,11 +105,5 @@ void MobileYouTubePlugin::OpenYoutubeUrlCallback( |
render_view()->LoadURLExternally( |
GetFrame(), request, blink::WebNavigationPolicyNewForegroundTab); |
} |
-void MobileYouTubePlugin::BindWebFrame(WebFrame* frame) { |
- PluginPlaceholder::BindWebFrame(frame); |
- BindCallback("openYoutubeURL", |
- base::Bind(&MobileYouTubePlugin::OpenYoutubeUrlCallback, |
- base::Unretained(this))); |
-} |
} // namespace plugins |