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

Side by Side Diff: components/plugins/renderer/plugin_placeholder.cc

Issue 1158063002: Add plugins::TestPluginPlaceholder class and allow its use in Blink layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pluginfix
Patch Set: 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 | « no previous file | content/content_shell.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/plugins/renderer/plugin_placeholder.h" 5 #include "components/plugins/renderer/plugin_placeholder.h"
6 6
7 #include "content/public/common/web_preferences.h"
7 #include "content/public/renderer/render_frame.h" 8 #include "content/public/renderer/render_frame.h"
8 9
9 namespace plugins { 10 namespace plugins {
10 11
11 gin::WrapperInfo PluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin}; 12 gin::WrapperInfo PluginPlaceholder::kWrapperInfo = {gin::kEmbedderNativeGin};
12 13
13 PluginPlaceholder::PluginPlaceholder(content::RenderFrame* render_frame, 14 PluginPlaceholder::PluginPlaceholder(content::RenderFrame* render_frame,
14 blink::WebLocalFrame* frame, 15 blink::WebLocalFrame* frame,
15 const blink::WebPluginParams& params, 16 const blink::WebPluginParams& params,
16 const std::string& html_data, 17 const std::string& html_data,
17 GURL placeholderDataUrl) 18 GURL placeholderDataUrl)
18 : content::RenderFrameObserver(render_frame), 19 : content::RenderFrameObserver(render_frame),
19 frame_(frame), 20 frame_(frame),
20 plugin_params_(params), 21 plugin_params_(params),
21 plugin_(WebViewPlugin::Create(this, 22 plugin_(WebViewPlugin::Create(this,
22 render_frame->GetWebkitPreferences(), 23 render_frame
24 ? render_frame->GetWebkitPreferences()
25 : content::WebPreferences(),
23 html_data, 26 html_data,
24 placeholderDataUrl)) { 27 placeholderDataUrl)) {
25 DCHECK(placeholderDataUrl.is_valid()) 28 DCHECK(placeholderDataUrl.is_valid())
26 << "Blink requires the placeholder to have a valid URL."; 29 << "Blink requires the placeholder to have a valid URL.";
27 } 30 }
28 31
29 PluginPlaceholder::~PluginPlaceholder() {} 32 PluginPlaceholder::~PluginPlaceholder() {}
30 33
31 const blink::WebPluginParams& PluginPlaceholder::GetPluginParams() const { 34 const blink::WebPluginParams& PluginPlaceholder::GetPluginParams() const {
32 return plugin_params_; 35 return plugin_params_;
(...skipping 14 matching lines...) Expand all
47 return v8::Local<v8::Object>(); 50 return v8::Local<v8::Object>();
48 } 51 }
49 52
50 void PluginPlaceholder::OnDestruct() { 53 void PluginPlaceholder::OnDestruct() {
51 frame_ = NULL; 54 frame_ = NULL;
52 } 55 }
53 56
54 blink::WebLocalFrame* PluginPlaceholder::GetFrame() { return frame_; } 57 blink::WebLocalFrame* PluginPlaceholder::GetFrame() { return frame_; }
55 58
56 } // namespace plugins 59 } // namespace plugins
OLDNEW
« no previous file with comments | « no previous file | content/content_shell.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698