OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 |
| 11 #include "content/common/content_export.h" |
| 12 #include "content/public/renderer/render_view.h" |
| 13 #include "ipc/ipc_sender.h" |
| 14 |
| 15 namespace base { |
| 16 class Value; |
| 17 } // namespace base |
| 18 |
| 19 namespace WebKit { |
| 20 class WebPluginContainer; |
| 21 } // namespace WebKit |
| 22 |
| 23 namespace content { |
| 24 |
| 25 class BrowserPluginMethodBinding; |
| 26 class BrowserPluginPropertyBinding; |
| 27 |
| 28 // A BrowserPlugin is a type of plugin that hosts out-of-process web content. |
| 29 // This interface exposes BrowserPlugin to the content API so that the |
| 30 // BrowserPlugin can be extended and customized with content-embedder-specific |
| 31 // API. |
| 32 class CONTENT_EXPORT BrowserPlugin : public IPC::Sender { |
| 33 public: |
| 34 virtual ~BrowserPlugin() {} |
| 35 |
| 36 // Returns the embedding RenderView of the BrowserPlugin. |
| 37 virtual RenderView* GetRenderView() const = 0; |
| 38 |
| 39 // Returns the container of the BrowserPlugin. |
| 40 virtual WebKit::WebPluginContainer* GetContainer() const = 0; |
| 41 |
| 42 // Adds a method binding to the BrowserPlugin. The BrowserPlugin takes |
| 43 // ownership of the method binding. The method binding will be destroyed when |
| 44 // the BrowserPlugin is destroyed, prior to cleaning up any |
| 45 // BrowserPluginObservers. |
| 46 virtual void AddMethodBinding(BrowserPluginMethodBinding* method_binding) = 0; |
| 47 |
| 48 // Adds a property binding to the BrowserPlugin. The BrowserPlugin takes |
| 49 // ownership of the property binding. The binding will be destroyed when |
| 50 // the BrowserPlugin is destroyed, prior to cleaning up any |
| 51 // BrowserPluginObservers. |
| 52 virtual void AddPropertyBinding( |
| 53 BrowserPluginPropertyBinding* property_binding) = 0; |
| 54 |
| 55 // Triggers the event-listeners for |event_name|. Note that the function |
| 56 // frees all the values in |props|. |
| 57 virtual void TriggerEvent( |
| 58 const std::string& event_name, |
| 59 std::map<std::string, base::Value*>* props) = 0; |
| 60 |
| 61 // Updates the DOM attribute called |attribute_name| with the value |
| 62 // |attribute_value|. |
| 63 virtual void UpdateDOMAttribute(const std::string& attribute_name, |
| 64 const std::string& attribue_value) = 0; |
| 65 |
| 66 // Removes the attribute |attribute_name| from the BrowserPlugin object. |
| 67 virtual void RemoveDOMAttribute(const std::string& attribute_name) = 0; |
| 68 |
| 69 // Gets Browser Plugin's DOM Node attribute |attribute_name|'s value. |
| 70 virtual std::string GetDOMAttributeValue( |
| 71 const std::string& attribute_name) const = 0; |
| 72 |
| 73 // Checks if the attribute |attribute_name| exists in the DOM. |
| 74 virtual bool HasDOMAttribute(const std::string& attribute_name) const = 0; |
| 75 |
| 76 // Indicates whether the BrowserPlugin has navigated within its lifetime. |
| 77 virtual bool HasNavigated() const = 0; |
| 78 }; |
| 79 |
| 80 } // namespace content |
| 81 |
| 82 #endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |