OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_ | 5 #ifndef CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_ |
6 #define CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_ | 6 #define CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/public/renderer/render_process_observer.h" | 9 #include "content/public/renderer/render_process_observer.h" |
10 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
12 #include "webkit/glue/cpp_bound_class.h" | 12 #include "webkit/glue/cpp_bound_class.h" |
13 #include "webkit/plugins/webplugininfo.h" | 13 #include "webkit/plugins/webplugininfo.h" |
14 #include "webkit/plugins/webview_plugin.h" | 14 #include "webkit/plugins/webview_plugin.h" |
15 | 15 |
16 struct ChromeViewHostMsg_GetPluginInfo_Status; | 16 struct ChromeViewHostMsg_GetPluginInfo_Status; |
17 | 17 |
18 namespace webkit { | 18 namespace webkit { |
19 struct WebPluginInfo; | |
20 namespace npapi { | 19 namespace npapi { |
21 class PluginGroup; | 20 class PluginGroup; |
22 } | 21 } |
| 22 struct WebPluginInfo; |
23 } | 23 } |
24 | 24 |
25 // Placeholders can be used if a plug-in is missing or not available | 25 // Placeholders can be used if a plug-in is missing or not available |
26 // (blocked or disabled). | 26 // (blocked or disabled). |
27 class PluginPlaceholder : public content::RenderViewObserver, | 27 class PluginPlaceholder : public content::RenderViewObserver, |
28 public content::RenderProcessObserver, | 28 public content::RenderProcessObserver, |
29 public CppBoundClass, | 29 public CppBoundClass, |
30 public webkit::WebViewPlugin::Delegate { | 30 public webkit::WebViewPlugin::Delegate { |
31 public: | 31 public: |
32 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. | 32 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. |
33 static PluginPlaceholder* CreateMissingPlugin( | 33 static PluginPlaceholder* CreateMissingPlugin( |
34 content::RenderView* render_view, | 34 content::RenderView* render_view, |
35 WebKit::WebFrame* frame, | 35 WebKit::WebFrame* frame, |
36 const WebKit::WebPluginParams& params); | 36 const WebKit::WebPluginParams& params); |
37 | 37 |
| 38 static PluginPlaceholder* CreateErrorPlugin( |
| 39 content::RenderView* render_view, |
| 40 const FilePath& plugin_path); |
| 41 |
38 static PluginPlaceholder* CreateBlockedPlugin( | 42 static PluginPlaceholder* CreateBlockedPlugin( |
39 content::RenderView* render_view, | 43 content::RenderView* render_view, |
40 WebKit::WebFrame* frame, | 44 WebKit::WebFrame* frame, |
41 const WebKit::WebPluginParams& params, | 45 const WebKit::WebPluginParams& params, |
42 const webkit::WebPluginInfo& info, | 46 const webkit::WebPluginInfo& info, |
43 const string16& name, | 47 const string16& name, |
44 int resource_id, | 48 int resource_id, |
45 int message_id); | 49 int message_id); |
46 | 50 |
47 webkit::WebViewPlugin* plugin() { return plugin_; } | 51 webkit::WebViewPlugin* plugin() { return plugin_; } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 152 |
149 bool hidden_; | 153 bool hidden_; |
150 bool has_host_; | 154 bool has_host_; |
151 bool finished_loading_; | 155 bool finished_loading_; |
152 string16 plugin_name_; | 156 string16 plugin_name_; |
153 | 157 |
154 DISALLOW_COPY_AND_ASSIGN(PluginPlaceholder); | 158 DISALLOW_COPY_AND_ASSIGN(PluginPlaceholder); |
155 }; | 159 }; |
156 | 160 |
157 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_ | 161 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_H_ |
OLD | NEW |