| Index: components/plugins/renderer/plugin_placeholder.cc
|
| diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc
|
| index 8bbe491c405cded2a3c55e8613179f48ee962fb1..328e381ada063df65cee7800c61f535342f1658a 100644
|
| --- a/components/plugins/renderer/plugin_placeholder.cc
|
| +++ b/components/plugins/renderer/plugin_placeholder.cc
|
| @@ -5,6 +5,8 @@
|
| #include "components/plugins/renderer/plugin_placeholder.h"
|
|
|
| #include "content/public/renderer/render_frame.h"
|
| +#include "gin/handle.h"
|
| +#include "third_party/WebKit/public/web/WebKit.h"
|
|
|
| namespace plugins {
|
|
|
| @@ -32,6 +34,18 @@ const blink::WebPluginParams& PluginPlaceholder::GetPluginParams() const {
|
| return plugin_params_;
|
| }
|
|
|
| +void PluginPlaceholder::BindWebFrame(blink::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());
|
| +}
|
| +
|
| void PluginPlaceholder::ShowContextMenu(const blink::WebMouseEvent& event) {
|
| // Does nothing by default. Will be overridden if a specific browser wants
|
| // a context menu.
|
|
|