Chromium Code Reviews| 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..427e8657bc725c4444b6b6f1378cf4cd0aa99ad8 100644 |
| --- a/components/plugins/renderer/mobile_youtube_plugin.cc |
| +++ b/components/plugins/renderer/mobile_youtube_plugin.cc |
| @@ -92,22 +92,26 @@ bool MobileYouTubePlugin::IsYouTubeURL(const GURL& url, |
| LowerCaseEqualsASCII(mime_type, content::kFlashPluginSwfMimeType); |
| } |
| +// static |
| void MobileYouTubePlugin::OpenYoutubeUrlCallback( |
| - const webkit_glue::CppArgumentList& args, |
| - webkit_glue::CppVariant* result) { |
| + const v8::FunctionCallbackInfo<v8::Value>& args) { |
|
Bernhard Bauer
2013/11/12 16:37:20
Move to anonymous namespace
|
| + MobileYouTubePlugin* plugin = reinterpret_cast<MobileYouTubePlugin*>( |
| + v8::External::Cast(*args.Data())->Value()); |
| std::string youtube("vnd.youtube:"); |
| - GURL url(youtube.append(GetYoutubeVideoId(GetPluginParams()))); |
| + GURL url(youtube.append(GetYoutubeVideoId(plugin->GetPluginParams()))); |
| WebURLRequest request; |
| request.initialize(); |
| request.setURL(url); |
| - render_view()->LoadURLExternally( |
| - GetFrame(), request, blink::WebNavigationPolicyNewForegroundTab); |
| + plugin->render_view()->LoadURLExternally( |
| + plugin->GetFrame(), request, blink::WebNavigationPolicyNewForegroundTab); |
| } |
| -void MobileYouTubePlugin::BindWebFrame(WebFrame* frame) { |
| - PluginPlaceholder::BindWebFrame(frame); |
| - BindCallback("openYoutubeURL", |
| - base::Bind(&MobileYouTubePlugin::OpenYoutubeUrlCallback, |
| - base::Unretained(this))); |
| + |
| +void MobileYouTubePlugin::InstallAdditionalCallbacsk( |
| + v8::Handle<v8::Template> prototype) { |
| + prototype->Set( |
| + v8::String::New("openYoutubeURL"), |
| + v8::FunctionTemplate::New(&PluginPlaceholder::OpenYoutubeUrlCallback, |
| + v8::External::New(this))->GetFunction()); |
| } |
| } // namespace plugins |