| 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 "chrome/renderer/plugins/power_saver_info.h" | |
| 9 #include "components/plugins/renderer/loadable_plugin_placeholder.h" | 8 #include "components/plugins/renderer/loadable_plugin_placeholder.h" |
| 10 #include "content/public/renderer/context_menu_client.h" | 9 #include "content/public/renderer/context_menu_client.h" |
| 11 #include "content/public/renderer/render_process_observer.h" | 10 #include "content/public/renderer/render_process_observer.h" |
| 12 | 11 |
| 12 namespace gfx { |
| 13 class Size; |
| 14 } |
| 15 |
| 13 enum class ChromeViewHostMsg_GetPluginInfo_Status; | 16 enum class ChromeViewHostMsg_GetPluginInfo_Status; |
| 14 | 17 |
| 18 // This contains information specifying the poster image of plugin placeholders. |
| 19 // The default constructor specifies no poster image. |
| 20 struct PlaceholderPosterInfo { |
| 21 // The poster image specified in image 'srcset' attribute format. |
| 22 std::string poster_attribute; |
| 23 |
| 24 // Used to resolve relative paths in |poster_attribute|. |
| 25 GURL base_url; |
| 26 |
| 27 // Specify this to provide partially obscured plugins a centered poster image. |
| 28 gfx::Size custom_poster_size; |
| 29 }; |
| 30 |
| 15 class ChromePluginPlaceholder final | 31 class ChromePluginPlaceholder final |
| 16 : public plugins::LoadablePluginPlaceholder, | 32 : public plugins::LoadablePluginPlaceholder, |
| 17 public content::RenderProcessObserver, | 33 public content::RenderProcessObserver, |
| 18 public content::ContextMenuClient, | 34 public content::ContextMenuClient, |
| 19 public gin::Wrappable<ChromePluginPlaceholder> { | 35 public gin::Wrappable<ChromePluginPlaceholder> { |
| 20 public: | 36 public: |
| 21 static gin::WrapperInfo kWrapperInfo; | 37 static gin::WrapperInfo kWrapperInfo; |
| 22 | 38 |
| 23 static ChromePluginPlaceholder* CreateBlockedPlugin( | 39 static ChromePluginPlaceholder* CreateBlockedPlugin( |
| 24 content::RenderFrame* render_frame, | 40 content::RenderFrame* render_frame, |
| 25 blink::WebLocalFrame* frame, | 41 blink::WebLocalFrame* frame, |
| 26 const blink::WebPluginParams& params, | 42 const blink::WebPluginParams& params, |
| 27 const content::WebPluginInfo& info, | 43 const content::WebPluginInfo& info, |
| 28 const std::string& identifier, | 44 const std::string& identifier, |
| 29 const base::string16& name, | 45 const base::string16& name, |
| 30 int resource_id, | 46 int resource_id, |
| 31 const base::string16& message, | 47 const base::string16& message, |
| 32 const PowerSaverInfo& power_saver_info); | 48 const PlaceholderPosterInfo& poster_info); |
| 33 | 49 |
| 34 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. | 50 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. |
| 35 static ChromePluginPlaceholder* CreateLoadableMissingPlugin( | 51 static ChromePluginPlaceholder* CreateLoadableMissingPlugin( |
| 36 content::RenderFrame* render_frame, | 52 content::RenderFrame* render_frame, |
| 37 blink::WebLocalFrame* frame, | 53 blink::WebLocalFrame* frame, |
| 38 const blink::WebPluginParams& params); | 54 const blink::WebPluginParams& params); |
| 39 | 55 |
| 40 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); | 56 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); |
| 41 | 57 |
| 42 #if defined(ENABLE_PLUGIN_INSTALLATION) | 58 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 #endif | 113 #endif |
| 98 | 114 |
| 99 bool has_host_; | 115 bool has_host_; |
| 100 int context_menu_request_id_; // Nonzero when request pending. | 116 int context_menu_request_id_; // Nonzero when request pending. |
| 101 base::string16 plugin_name_; | 117 base::string16 plugin_name_; |
| 102 | 118 |
| 103 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); | 119 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); |
| 104 }; | 120 }; |
| 105 | 121 |
| 106 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ | 122 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ |
| OLD | NEW |