| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "chrome/renderer/plugins/power_saver_info.h" | 12 #include "chrome/renderer/plugins/power_saver_info.h" |
| 12 #include "components/plugins/renderer/loadable_plugin_placeholder.h" | 13 #include "components/plugins/renderer/loadable_plugin_placeholder.h" |
| 13 #include "content/public/renderer/context_menu_client.h" | 14 #include "content/public/renderer/context_menu_client.h" |
| 14 #include "content/public/renderer/render_thread_observer.h" | 15 #include "content/public/renderer/render_thread_observer.h" |
| 15 | 16 |
| 16 enum class ChromeViewHostMsg_GetPluginInfo_Status; | 17 enum class ChromeViewHostMsg_GetPluginInfo_Status; |
| 17 | 18 |
| 18 class ChromePluginPlaceholder final | 19 class ChromePluginPlaceholder final |
| (...skipping 19 matching lines...) Expand all Loading... |
| 38 const PowerSaverInfo& power_saver_info); | 39 const PowerSaverInfo& power_saver_info); |
| 39 | 40 |
| 40 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. | 41 // Creates a new WebViewPlugin with a MissingPlugin as a delegate. |
| 41 static ChromePluginPlaceholder* CreateLoadableMissingPlugin( | 42 static ChromePluginPlaceholder* CreateLoadableMissingPlugin( |
| 42 content::RenderFrame* render_frame, | 43 content::RenderFrame* render_frame, |
| 43 blink::WebLocalFrame* frame, | 44 blink::WebLocalFrame* frame, |
| 44 const blink::WebPluginParams& params); | 45 const blink::WebPluginParams& params); |
| 45 | 46 |
| 46 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); | 47 void SetStatus(ChromeViewHostMsg_GetPluginInfo_Status status); |
| 47 | 48 |
| 48 #if defined(ENABLE_PLUGIN_INSTALLATION) | |
| 49 int32_t CreateRoutingId(); | 49 int32_t CreateRoutingId(); |
| 50 #endif | |
| 51 | 50 |
| 52 private: | 51 private: |
| 53 ChromePluginPlaceholder(content::RenderFrame* render_frame, | 52 ChromePluginPlaceholder(content::RenderFrame* render_frame, |
| 54 blink::WebLocalFrame* frame, | 53 blink::WebLocalFrame* frame, |
| 55 const blink::WebPluginParams& params, | 54 const blink::WebPluginParams& params, |
| 56 const std::string& html_data, | 55 const std::string& html_data, |
| 57 const base::string16& title); | 56 const base::string16& title); |
| 58 ~ChromePluginPlaceholder() override; | 57 ~ChromePluginPlaceholder() override; |
| 59 | 58 |
| 60 // content::LoadablePluginPlaceholder overrides. | 59 // content::LoadablePluginPlaceholder overrides. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 85 | 84 |
| 86 // IPC message handlers: | 85 // IPC message handlers: |
| 87 #if defined(ENABLE_PLUGIN_INSTALLATION) | 86 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 88 void OnDidNotFindMissingPlugin(); | 87 void OnDidNotFindMissingPlugin(); |
| 89 void OnFoundMissingPlugin(const base::string16& plugin_name); | 88 void OnFoundMissingPlugin(const base::string16& plugin_name); |
| 90 void OnStartedDownloadingPlugin(); | 89 void OnStartedDownloadingPlugin(); |
| 91 void OnFinishedDownloadingPlugin(); | 90 void OnFinishedDownloadingPlugin(); |
| 92 void OnErrorDownloadingPlugin(const std::string& error); | 91 void OnErrorDownloadingPlugin(const std::string& error); |
| 93 void OnCancelledDownloadingPlugin(); | 92 void OnCancelledDownloadingPlugin(); |
| 94 #endif | 93 #endif |
| 94 void OnPluginComponentUpdateDownloading(); |
| 95 void OnPluginComponentUpdateSuccess(); |
| 96 void OnPluginComponentUpdateFailure(); |
| 95 | 97 |
| 96 ChromeViewHostMsg_GetPluginInfo_Status status_; | 98 ChromeViewHostMsg_GetPluginInfo_Status status_; |
| 97 | 99 |
| 98 base::string16 title_; | 100 base::string16 title_; |
| 99 | 101 |
| 100 #if defined(ENABLE_PLUGIN_INSTALLATION) | |
| 101 // |routing_id()| is the routing ID of our associated RenderView, but we have | 102 // |routing_id()| is the routing ID of our associated RenderView, but we have |
| 102 // a separate routing ID for messages specific to this placeholder. | 103 // a separate routing ID for messages specific to this placeholder. |
| 103 int32_t placeholder_routing_id_ = MSG_ROUTING_NONE; | 104 int32_t placeholder_routing_id_ = MSG_ROUTING_NONE; |
| 104 | 105 |
| 106 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 105 bool has_host_ = false; | 107 bool has_host_ = false; |
| 106 #endif | 108 #endif |
| 107 | 109 |
| 108 int context_menu_request_id_; // Nonzero when request pending. | 110 int context_menu_request_id_; // Nonzero when request pending. |
| 109 base::string16 plugin_name_; | 111 base::string16 plugin_name_; |
| 110 | 112 |
| 111 bool did_send_blocked_content_notification_; | 113 bool did_send_blocked_content_notification_; |
| 112 | 114 |
| 113 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); | 115 DISALLOW_COPY_AND_ASSIGN(ChromePluginPlaceholder); |
| 114 }; | 116 }; |
| 115 | 117 |
| 116 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ | 118 #endif // CHROME_RENDERER_PLUGINS_CHROME_PLUGIN_PLACEHOLDER_H_ |
| OLD | NEW |