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

Unified Diff: components/plugins/renderer/mobile_youtube_plugin.cc

Issue 69953006: Bind plugin placeholder directly to v8 instead of over CppBoundClass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 1 month 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
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

Powered by Google App Engine
This is Rietveld 408576698