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