| 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..df13319c46217e3f383049d7c6a4a8fc363d0ac4 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) {
|
| + 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::InstallAdditionalCallbacks(
|
| + v8::Handle<v8::Template> prototype) {
|
| + prototype->Set(
|
| + v8::String::New("openYoutubeURL"),
|
| + v8::FunctionTemplate::New(&MobileYouTubePlugin::OpenYoutubeUrlCallback,
|
| + v8::External::New(this))->GetFunction());
|
| }
|
|
|
| } // namespace plugins
|
|
|