| OLD | NEW |
| 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 #ifndef CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ | 5 #ifndef CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ |
| 6 #define CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ | 6 #define CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ |
| 7 | 7 |
| 8 #include "components/plugins/renderer/loadable_plugin_placeholder.h" | 8 #include "components/plugins/renderer/loadable_plugin_placeholder.h" |
| 9 #include "content/public/renderer/context_menu_client.h" | 9 #include "content/public/renderer/context_menu_client.h" |
| 10 #include "content/public/renderer/render_process_observer.h" | 10 #include "content/public/renderer/render_process_observer.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 GURL base_url; | 25 GURL base_url; |
| 26 | 26 |
| 27 // Specify this to provide partially obscured plugins a centered poster image. | 27 // Specify this to provide partially obscured plugins a centered poster image. |
| 28 gfx::Size custom_poster_size; | 28 gfx::Size custom_poster_size; |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 class ChromePluginPlaceholder : public plugins::LoadablePluginPlaceholder, | 31 class ChromePluginPlaceholder : public plugins::LoadablePluginPlaceholder, |
| 32 public content::RenderProcessObserver, | 32 public content::RenderProcessObserver, |
| 33 public content::ContextMenuClient { | 33 public content::ContextMenuClient { |
| 34 public: | 34 public: |
| 35 static const char kPluginPlaceholderDataURL[]; | 35 static gin::WrapperInfo kWrapperInfo; |
| 36 | 36 |
| 37 static ChromePluginPlaceholder* CreateBlockedPlugin( | 37 static ChromePluginPlaceholder* CreateBlockedPlugin( |
| 38 content::RenderFrame* render_frame, | 38 content::RenderFrame* render_frame, |
| 39 blink::WebLocalFrame* frame, | 39 blink::WebLocalFrame* frame, |
| 40 const blink::WebPluginParams& params, | 40 const blink::WebPluginParams& params, |
| 41 const content::WebPluginInfo& info, | 41 const content::WebPluginInfo& info, |
| 42 const std::string& identifier, | 42 const std::string& identifier, |
| 43 const base::string16& name, | 43 const base::string16& name, |
| 44 int resource_id, | 44 int resource_id, |
| 45 const base::string16& message, | 45 const base::string16& message, |
| 46 const PlaceholderPosterInfo& poster_info); | 46 const PlaceholderPosterInfo& poster_info); |
| 47 | 47 |
| 48 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. | 48 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. |
| 49 static ChromePluginPlaceholder* CreateMissingPlugin( | 49 static ChromePluginPlaceholder* CreateLoadableMissingPlugin( |
| 50 content::RenderFrame* render_frame, | 50 content::RenderFrame* render_frame, |
| 51 blink::WebLocalFrame* frame, | 51 blink::WebLocalFrame* frame, |
| 52 const blink::WebPluginParams& params); | 52 const blink::WebPluginParams& params); |
| 53 | 53 |
| 54 static ChromePluginPlaceholder* CreateErrorPlugin( | |
| 55 content::RenderFrame* render_frame, | |
| 56 const base::FilePath& plugin_path); | |
| 57 | |
| 58 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); | 54 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); |
| 59 | 55 |
| 60 #if defined(ENABLE_PLUGIN_INSTALLATION) | 56 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 61 int32 CreateRoutingId(); | 57 int32 CreateRoutingId(); |
| 62 #endif | 58 #endif |
| 63 | 59 |
| 60 // gin::Wrappable (via PluginPlaceholder) method |
| 61 gin::WrapperInfo* GetWrapperInfo() override; |
| 62 |
| 64 private: | 63 private: |
| 65 ChromePluginPlaceholder(content::RenderFrame* render_frame, | 64 ChromePluginPlaceholder(content::RenderFrame* render_frame, |
| 66 blink::WebLocalFrame* frame, | 65 blink::WebLocalFrame* frame, |
| 67 const blink::WebPluginParams& params, | 66 const blink::WebPluginParams& params, |
| 68 const std::string& html_data, | 67 const std::string& html_data, |
| 69 const base::string16& title); | 68 const base::string16& title); |
| 70 ~ChromePluginPlaceholder() override; | 69 ~ChromePluginPlaceholder() override; |
| 71 | 70 |
| 72 // content::LoadablePluginPlaceholder method | 71 // content::LoadablePluginPlaceholder method |
| 73 blink::WebPlugin* CreatePlugin() override; | 72 blink::WebPlugin* CreatePlugin() override; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 #endif | 113 #endif |
| 115 | 114 |
| 116 bool has_host_; | 115 bool has_host_; |
| 117 int context_menu_request_id_; // Nonzero when request pending. | 116 int context_menu_request_id_; // Nonzero when request pending. |
| 118 base::string16 plugin_name_; | 117 base::string16 plugin_name_; |
| 119 | 118 |
| 120 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); | 119 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); |
| 121 }; | 120 }; |
| 122 | 121 |
| 123 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ | 122 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ |
| OLD | NEW |