| 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 COMPONENTS_PLUGINS_RENDERER_PLUGIN_PLACEHOLDER_H_ | 5 #ifndef COMPONENTS_PLUGINS_RENDERER_PLUGIN_PLACEHOLDER_H_ |
| 6 #define COMPONENTS_PLUGINS_RENDERER_PLUGIN_PLACEHOLDER_H_ | 6 #define COMPONENTS_PLUGINS_RENDERER_PLUGIN_PLACEHOLDER_H_ |
| 7 | 7 |
| 8 #include "components/plugins/renderer/webview_plugin.h" | 8 #include "components/plugins/renderer/webview_plugin.h" |
| 9 #include "content/public/common/webplugininfo.h" | 9 #include "content/public/common/webplugininfo.h" |
| 10 #include "content/public/renderer/context_menu_client.h" | 10 #include "content/public/renderer/context_menu_client.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 // |render_frame| and |frame| are weak pointers. If either one is going away, | 38 // |render_frame| and |frame| are weak pointers. If either one is going away, |
| 39 // our |plugin_| will be destroyed as well and will notify us. | 39 // our |plugin_| will be destroyed as well and will notify us. |
| 40 PluginPlaceholder(content::RenderFrame* render_frame, | 40 PluginPlaceholder(content::RenderFrame* render_frame, |
| 41 blink::WebLocalFrame* frame, | 41 blink::WebLocalFrame* frame, |
| 42 const blink::WebPluginParams& params, | 42 const blink::WebPluginParams& params, |
| 43 const std::string& html_data, | 43 const std::string& html_data, |
| 44 GURL placeholderDataUrl); | 44 GURL placeholderDataUrl); |
| 45 | 45 |
| 46 virtual ~PluginPlaceholder(); | 46 ~PluginPlaceholder() override; |
| 47 | 47 |
| 48 void OnLoadBlockedPlugins(const std::string& identifier); | 48 void OnLoadBlockedPlugins(const std::string& identifier); |
| 49 void OnSetIsPrerendering(bool is_prerendering); | 49 void OnSetIsPrerendering(bool is_prerendering); |
| 50 | 50 |
| 51 void SetMessage(const base::string16& message); | 51 void SetMessage(const base::string16& message); |
| 52 void SetPluginInfo(const content::WebPluginInfo& plugin_info); | 52 void SetPluginInfo(const content::WebPluginInfo& plugin_info); |
| 53 const content::WebPluginInfo& GetPluginInfo() const; | 53 const content::WebPluginInfo& GetPluginInfo() const; |
| 54 void SetIdentifier(const std::string& identifier); | 54 void SetIdentifier(const std::string& identifier); |
| 55 blink::WebLocalFrame* GetFrame(); | 55 blink::WebLocalFrame* GetFrame(); |
| 56 const blink::WebPluginParams& GetPluginParams() const; | 56 const blink::WebPluginParams& GetPluginParams() const; |
| 57 bool LoadingAllowed() const { return allow_loading_; } | 57 bool LoadingAllowed() const { return allow_loading_; } |
| 58 | 58 |
| 59 // Replace this placeholder with a different plugin (which could be | 59 // Replace this placeholder with a different plugin (which could be |
| 60 // a placeholder again). | 60 // a placeholder again). |
| 61 void ReplacePlugin(blink::WebPlugin* new_plugin); | 61 void ReplacePlugin(blink::WebPlugin* new_plugin); |
| 62 | 62 |
| 63 // Hide this placeholder. | 63 // Hide this placeholder. |
| 64 void HidePlugin(); | 64 void HidePlugin(); |
| 65 | 65 |
| 66 // Load the blocked plugin. | 66 // Load the blocked plugin. |
| 67 void LoadPlugin(); | 67 void LoadPlugin(); |
| 68 | 68 |
| 69 // gin::Wrappable method: | 69 // gin::Wrappable method: |
| 70 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( | 70 gin::ObjectTemplateBuilder GetObjectTemplateBuilder( |
| 71 v8::Isolate* isolate) override; | 71 v8::Isolate* isolate) override; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 // WebViewPlugin::Delegate methods: | 74 // WebViewPlugin::Delegate methods: |
| 75 virtual void ShowContextMenu(const blink::WebMouseEvent&) override; | 75 void ShowContextMenu(const blink::WebMouseEvent&) override; |
| 76 virtual void PluginDestroyed() override; | 76 void PluginDestroyed() override; |
| 77 | 77 |
| 78 // RenderFrameObserver methods: | 78 // RenderFrameObserver methods: |
| 79 virtual void OnDestruct() override; | 79 void OnDestruct() override; |
| 80 | 80 |
| 81 // Javascript callbacks: | 81 // Javascript callbacks: |
| 82 | 82 |
| 83 // Load the blocked plugin by calling LoadPlugin(). | 83 // Load the blocked plugin by calling LoadPlugin(). |
| 84 void LoadCallback(); | 84 void LoadCallback(); |
| 85 | 85 |
| 86 // Hide the blocked plugin by calling HidePlugin(). | 86 // Hide the blocked plugin by calling HidePlugin(). |
| 87 void HideCallback(); | 87 void HideCallback(); |
| 88 | 88 |
| 89 void DidFinishLoadingCallback(); | 89 void DidFinishLoadingCallback(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 106 bool hidden_; | 106 bool hidden_; |
| 107 bool finished_loading_; | 107 bool finished_loading_; |
| 108 std::string identifier_; | 108 std::string identifier_; |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(PluginPlaceholder); | 110 DISALLOW_COPY_AND_ASSIGN(PluginPlaceholder); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace plugins | 113 } // namespace plugins |
| 114 | 114 |
| 115 #endif // COMPONENTS_PLUGINS_RENDERER_PLUGIN_PLACEHOLDER_H_ | 115 #endif // COMPONENTS_PLUGINS_RENDERER_PLUGIN_PLACEHOLDER_H_ |
| OLD | NEW |