| 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" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Size; | 13 class Size; |
| 14 } | 14 } |
| 15 | 15 |
| 16 struct ChromeViewHostMsg_GetPluginInfo_Status; | 16 enum class ChromeViewHostMsg_GetPluginInfo_Status; |
| 17 | 17 |
| 18 // This contains information specifying the poster image of plugin placeholders. | 18 // This contains information specifying the poster image of plugin placeholders. |
| 19 // The default constructor specifies no poster image. | 19 // The default constructor specifies no poster image. |
| 20 struct PlaceholderPosterInfo { | 20 struct PlaceholderPosterInfo { |
| 21 // The poster image specified in image 'srcset' attribute format. | 21 // The poster image specified in image 'srcset' attribute format. |
| 22 std::string poster_attribute; | 22 std::string poster_attribute; |
| 23 | 23 |
| 24 // Used to resolve relative paths in |poster_attribute|. | 24 // Used to resolve relative paths in |poster_attribute|. |
| 25 GURL base_url; | 25 GURL base_url; |
| 26 | 26 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 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* CreateMissingPlugin( |
| 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( | 54 static ChromePluginPlaceholder* CreateErrorPlugin( |
| 55 content::RenderFrame* render_frame, | 55 content::RenderFrame* render_frame, |
| 56 const base::FilePath& plugin_path); | 56 const base::FilePath& plugin_path); |
| 57 | 57 |
| 58 void SetStatus(const ChromeViewHostMsg_GetPluginInfo_Status& status); | 58 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); |
| 59 | 59 |
| 60 #if defined(ENABLE_PLUGIN_INSTALLATION) | 60 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 61 int32 CreateRoutingId(); | 61 int32 CreateRoutingId(); |
| 62 #endif | 62 #endif |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 ChromePluginPlaceholder(content::RenderFrame* render_frame, | 65 ChromePluginPlaceholder(content::RenderFrame* render_frame, |
| 66 blink::WebLocalFrame* frame, | 66 blink::WebLocalFrame* frame, |
| 67 const blink::WebPluginParams& params, | 67 const blink::WebPluginParams& params, |
| 68 const std::string& html_data, | 68 const std::string& html_data, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 94 | 94 |
| 95 #if defined(ENABLE_PLUGIN_INSTALLATION) | 95 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 96 void OnDidNotFindMissingPlugin(); | 96 void OnDidNotFindMissingPlugin(); |
| 97 void OnFoundMissingPlugin(const base::string16& plugin_name); | 97 void OnFoundMissingPlugin(const base::string16& plugin_name); |
| 98 void OnStartedDownloadingPlugin(); | 98 void OnStartedDownloadingPlugin(); |
| 99 void OnFinishedDownloadingPlugin(); | 99 void OnFinishedDownloadingPlugin(); |
| 100 void OnErrorDownloadingPlugin(const std::string& error); | 100 void OnErrorDownloadingPlugin(const std::string& error); |
| 101 void OnCancelledDownloadingPlugin(); | 101 void OnCancelledDownloadingPlugin(); |
| 102 #endif | 102 #endif |
| 103 | 103 |
| 104 // We use a scoped_ptr so we can forward-declare the struct; it's defined in | 104 ChromeViewHostMsg_GetPluginInfo_Status status_; |
| 105 // an IPC message file which can't be easily included in other header files. | |
| 106 scoped_ptr<ChromeViewHostMsg_GetPluginInfo_Status> status_; | |
| 107 | 105 |
| 108 base::string16 title_; | 106 base::string16 title_; |
| 109 | 107 |
| 110 #if defined(ENABLE_PLUGIN_INSTALLATION) | 108 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 111 // |routing_id()| is the routing ID of our associated RenderView, but we have | 109 // |routing_id()| is the routing ID of our associated RenderView, but we have |
| 112 // a separate routing ID for messages specific to this placeholder. | 110 // a separate routing ID for messages specific to this placeholder. |
| 113 int32 placeholder_routing_id_; | 111 int32 placeholder_routing_id_; |
| 114 #endif | 112 #endif |
| 115 | 113 |
| 116 bool has_host_; | 114 bool has_host_; |
| 117 int context_menu_request_id_; // Nonzero when request pending. | 115 int context_menu_request_id_; // Nonzero when request pending. |
| 118 base::string16 plugin_name_; | 116 base::string16 plugin_name_; |
| 119 | 117 |
| 120 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); | 118 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); |
| 121 }; | 119 }; |
| 122 | 120 |
| 123 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ | 121 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ |
| OLD | NEW |