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

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..229be561bd8a22d3d1653d05b04af8f093236710 100644
--- a/components/plugins/renderer/mobile_youtube_plugin.cc
+++ b/components/plugins/renderer/mobile_youtube_plugin.cc
@@ -79,7 +79,14 @@ MobileYouTubePlugin::MobileYouTubePlugin(content::RenderView* render_view,
frame,
params,
HtmlData(params, template_html),
- placeholderDataUrl) {}
+ placeholderDataUrl),
+ weak_factory_(this) {
+ RegisterCallback("openYoutubeURL",
+ base::Bind(&MobileYouTubePlugin::OpenYoutubeUrlCallback,
+ weak_factory_.GetWeakPtr()));
+}
+
+MobileYouTubePlugin::~MobileYouTubePlugin() {}
// static
bool MobileYouTubePlugin::IsYouTubeURL(const GURL& url,
@@ -92,9 +99,7 @@ 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::OpenYoutubeUrlCallback() {
std::string youtube("vnd.youtube:");
GURL url(youtube.append(GetYoutubeVideoId(GetPluginParams())));
WebURLRequest request;
@@ -103,11 +108,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
« no previous file with comments | « components/plugins/renderer/mobile_youtube_plugin.h ('k') | components/plugins/renderer/plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698