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

Side by Side Diff: chrome/renderer/plugins/non_loadable_plugin_placeholder.cc

Issue 2855123003: Remove rendundant WebLocalFrame parameter in various plugin code. (Closed)
Patch Set: Fix Android Created 3 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "chrome/renderer/plugins/non_loadable_plugin_placeholder.h" 5 #include "chrome/renderer/plugins/non_loadable_plugin_placeholder.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/common/render_messages.h" 9 #include "chrome/common/render_messages.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
11 #include "chrome/grit/renderer_resources.h" 11 #include "chrome/grit/renderer_resources.h"
12 #include "components/plugins/renderer/plugin_placeholder.h" 12 #include "components/plugins/renderer/plugin_placeholder.h"
13 #include "components/strings/grit/components_strings.h" 13 #include "components/strings/grit/components_strings.h"
14 #include "content/app/strings/grit/content_strings.h" 14 #include "content/app/strings/grit/content_strings.h"
15 #include "content/public/renderer/render_thread.h" 15 #include "content/public/renderer/render_thread.h"
16 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
17 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
18 #include "ui/base/webui/jstemplate_builder.h" 18 #include "ui/base/webui/jstemplate_builder.h"
19 19
20 // static 20 // static
21 plugins::PluginPlaceholder* 21 plugins::PluginPlaceholder*
22 NonLoadablePluginPlaceholder::CreateNotSupportedPlugin( 22 NonLoadablePluginPlaceholder::CreateNotSupportedPlugin(
23 content::RenderFrame* render_frame, 23 content::RenderFrame* render_frame,
24 blink::WebLocalFrame* frame,
25 const blink::WebPluginParams& params) { 24 const blink::WebPluginParams& params) {
26 const base::StringPiece template_html( 25 const base::StringPiece template_html(
27 ResourceBundle::GetSharedInstance().GetRawDataResource( 26 ResourceBundle::GetSharedInstance().GetRawDataResource(
28 IDR_BLOCKED_PLUGIN_HTML)); 27 IDR_BLOCKED_PLUGIN_HTML));
29 28
30 base::DictionaryValue values; 29 base::DictionaryValue values;
31 values.SetString("message", 30 values.SetString("message",
32 l10n_util::GetStringUTF8(IDS_PLUGIN_NOT_SUPPORTED)); 31 l10n_util::GetStringUTF8(IDS_PLUGIN_NOT_SUPPORTED));
33 32
34 std::string html_data = webui::GetI18nTemplateHtml(template_html, &values); 33 std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
35 34
36 // PluginPlaceholder will destroy itself when its WebViewPlugin is going away. 35 // PluginPlaceholder will destroy itself when its WebViewPlugin is going away.
37 return new plugins::PluginPlaceholder(render_frame, frame, params, html_data); 36 return new plugins::PluginPlaceholder(render_frame, params, html_data);
38 } 37 }
39 38
40 // static 39 // static
41 plugins::PluginPlaceholder* NonLoadablePluginPlaceholder::CreateErrorPlugin( 40 plugins::PluginPlaceholder* NonLoadablePluginPlaceholder::CreateErrorPlugin(
42 content::RenderFrame* render_frame, 41 content::RenderFrame* render_frame,
43 const base::FilePath& file_path) { 42 const base::FilePath& file_path) {
44 base::DictionaryValue values; 43 base::DictionaryValue values;
45 values.SetString("message", 44 values.SetString("message",
46 l10n_util::GetStringUTF8(IDS_PLUGIN_INITIALIZATION_ERROR)); 45 l10n_util::GetStringUTF8(IDS_PLUGIN_INITIALIZATION_ERROR));
47 46
48 const base::StringPiece template_html( 47 const base::StringPiece template_html(
49 ResourceBundle::GetSharedInstance().GetRawDataResource( 48 ResourceBundle::GetSharedInstance().GetRawDataResource(
50 IDR_BLOCKED_PLUGIN_HTML)); 49 IDR_BLOCKED_PLUGIN_HTML));
51 std::string html_data = webui::GetI18nTemplateHtml(template_html, &values); 50 std::string html_data = webui::GetI18nTemplateHtml(template_html, &values);
52 51
53 blink::WebPluginParams params; 52 blink::WebPluginParams params;
54 // PluginPlaceholder will destroy itself when its WebViewPlugin is going away. 53 // PluginPlaceholder will destroy itself when its WebViewPlugin is going away.
55 plugins::PluginPlaceholder* plugin = 54 plugins::PluginPlaceholder* plugin =
56 new plugins::PluginPlaceholder(render_frame, nullptr, params, html_data); 55 new plugins::PluginPlaceholder(render_frame, params, html_data);
57 56
58 content::RenderThread::Get()->Send(new ChromeViewHostMsg_CouldNotLoadPlugin( 57 content::RenderThread::Get()->Send(new ChromeViewHostMsg_CouldNotLoadPlugin(
59 plugin->routing_id(), file_path)); 58 plugin->routing_id(), file_path));
60 return plugin; 59 return plugin;
61 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698