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

Side by Side Diff: content/shell/renderer/layout_test/test_plugin_placeholder.cc

Issue 1161923004: Reland: Plugin Placeholders: Refactor for platforms that don't support plugins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove some enable_plugins that are no longer needed Created 5 years, 6 months 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 unified diff | Download patch
« no previous file with comments | « content/shell/renderer/layout_test/test_plugin_placeholder.h ('k') | gin/wrappable.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/shell/renderer/layout_test/test_plugin_placeholder.h"
6
7 #include "gin/handle.h"
8 #include "third_party/WebKit/public/web/WebKit.h"
9
10 namespace content {
11
12 TestPluginPlaceholder::TestPluginPlaceholder(
13 RenderFrame* render_frame,
14 blink::WebLocalFrame* frame,
15 const blink::WebPluginParams& params)
16 : PluginPlaceholder(render_frame,
17 frame,
18 params,
19 "<div>Test content</div>",
20 GURL("http://www.test.com")) {
21 }
22
23 void TestPluginPlaceholder::BindWebFrame(blink::WebFrame* frame) {
24 v8::Isolate* isolate = blink::mainThreadIsolate();
25 v8::HandleScope handle_scope(isolate);
26 v8::Local<v8::Context> context = frame->mainWorldScriptContext();
27 DCHECK(!context.IsEmpty());
28
29 v8::Context::Scope context_scope(context);
30 v8::Local<v8::Object> global = context->Global();
31 global->Set(gin::StringToV8(isolate, "plugin"),
32 gin::CreateHandle(isolate, this).ToV8());
33 }
34
35 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/test_plugin_placeholder.h ('k') | gin/wrappable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698