| 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 4664db7513c878a6973c6ad9c95289f068b90409..b5b9498bbcc64a88b9d193da9c3d9280a99f36df 100644
|
| --- a/components/plugins/renderer/mobile_youtube_plugin.cc
|
| +++ b/components/plugins/renderer/mobile_youtube_plugin.cc
|
| @@ -11,10 +11,8 @@
|
| #include "base/values.h"
|
| #include "content/public/common/content_constants.h"
|
| #include "content/public/renderer/render_frame.h"
|
| -#include "gin/handle.h"
|
| #include "gin/object_template_builder.h"
|
| #include "third_party/WebKit/public/web/WebFrame.h"
|
| -#include "third_party/WebKit/public/web/WebKit.h"
|
| #include "ui/base/webui/jstemplate_builder.h"
|
|
|
| using blink::WebFrame;
|
| @@ -73,16 +71,17 @@ bool IsValidYouTubeVideo(const std::string& path) {
|
|
|
| namespace plugins {
|
|
|
| +gin::WrapperInfo MobileYouTubePlugin::kWrapperInfo = {gin::kEmbedderNativeGin};
|
| +
|
| MobileYouTubePlugin::MobileYouTubePlugin(content::RenderFrame* render_frame,
|
| blink::WebLocalFrame* frame,
|
| const blink::WebPluginParams& params,
|
| - base::StringPiece& template_html,
|
| - GURL placeholderDataUrl)
|
| - : PluginPlaceholder(render_frame,
|
| - frame,
|
| - params,
|
| - HtmlData(params, template_html),
|
| - placeholderDataUrl) {}
|
| + base::StringPiece& template_html)
|
| + : PluginPlaceholderBase(render_frame,
|
| + frame,
|
| + params,
|
| + HtmlData(params, template_html)) {
|
| +}
|
|
|
| MobileYouTubePlugin::~MobileYouTubePlugin() {}
|
|
|
| @@ -107,22 +106,15 @@ void MobileYouTubePlugin::OpenYoutubeUrlCallback() {
|
| GetFrame(), request, blink::WebNavigationPolicyNewForegroundTab);
|
| }
|
|
|
| -void MobileYouTubePlugin::BindWebFrame(WebFrame* frame) {
|
| - v8::Isolate* isolate = blink::mainThreadIsolate();
|
| - v8::HandleScope handle_scope(isolate);
|
| - v8::Local<v8::Context> context = frame->mainWorldScriptContext();
|
| - DCHECK(!context.IsEmpty());
|
| -
|
| - v8::Context::Scope context_scope(context);
|
| - v8::Local<v8::Object> global = context->Global();
|
| - global->Set(gin::StringToV8(isolate, "plugin"),
|
| - gin::CreateHandle(isolate, this).ToV8());
|
| +v8::Local<v8::Value> MobileYouTubePlugin::GetV8Handle(v8::Isolate* isolate) {
|
| + return gin::CreateHandle(isolate, this).ToV8();
|
| }
|
|
|
| gin::ObjectTemplateBuilder MobileYouTubePlugin::GetObjectTemplateBuilder(
|
| v8::Isolate* isolate) {
|
| - return PluginPlaceholder::GetObjectTemplateBuilder(isolate)
|
| - .SetMethod("openYoutubeURL", &MobileYouTubePlugin::OpenYoutubeUrlCallback);
|
| + return gin::Wrappable<MobileYouTubePlugin>::GetObjectTemplateBuilder(isolate)
|
| + .SetMethod("openYoutubeURL",
|
| + &MobileYouTubePlugin::OpenYoutubeUrlCallback);
|
| }
|
|
|
| } // namespace plugins
|
|
|