OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
7 | 7 |
8 #include "third_party/WebKit/public/web/WebPlugin.h" | 8 #include "third_party/WebKit/public/web/WebPlugin.h" |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void RemoveDOMAttribute(const std::string& attribute_name); | 53 void RemoveDOMAttribute(const std::string& attribute_name); |
54 // Get Browser Plugin's DOM Node attribute |attribute_name|'s value. | 54 // Get Browser Plugin's DOM Node attribute |attribute_name|'s value. |
55 std::string GetDOMAttributeValue(const std::string& attribute_name) const; | 55 std::string GetDOMAttributeValue(const std::string& attribute_name) const; |
56 // Checks if the attribute |attribute_name| exists in the DOM. | 56 // Checks if the attribute |attribute_name| exists in the DOM. |
57 bool HasDOMAttribute(const std::string& attribute_name) const; | 57 bool HasDOMAttribute(const std::string& attribute_name) const; |
58 | 58 |
59 // Get the name attribute value. | 59 // Get the name attribute value. |
60 std::string GetNameAttribute() const; | 60 std::string GetNameAttribute() const; |
61 // Parse the name attribute value. | 61 // Parse the name attribute value. |
62 void ParseNameAttribute(); | 62 void ParseNameAttribute(); |
| 63 // Get the allowtransparency attribute value. |
| 64 bool GetAllowTransparencyAttribute() const; |
| 65 // Parse the allowtransparency attribute and adjust transparency of |
| 66 // BrowserPlugin accordingly. |
| 67 void ParseAllowTransparencyAttribute(); |
63 // Get the src attribute value of the BrowserPlugin instance. | 68 // Get the src attribute value of the BrowserPlugin instance. |
64 std::string GetSrcAttribute() const; | 69 std::string GetSrcAttribute() const; |
65 // Parse the src attribute value of the BrowserPlugin instance. | 70 // Parse the src attribute value of the BrowserPlugin instance. |
66 bool ParseSrcAttribute(std::string* error_message); | 71 bool ParseSrcAttribute(std::string* error_message); |
67 // Get the autosize attribute value. | 72 // Get the autosize attribute value. |
68 bool GetAutoSizeAttribute() const; | 73 bool GetAutoSizeAttribute() const; |
69 // Parses the autosize attribute value. | 74 // Parses the autosize attribute value. |
70 void ParseAutoSizeAttribute(); | 75 void ParseAutoSizeAttribute(); |
71 // Get the maxheight attribute value. | 76 // Get the maxheight attribute value. |
72 int GetMaxHeightAttribute() const; | 77 int GetMaxHeightAttribute() const; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void OnInstanceIDAllocated(int guest_instance_id); | 133 void OnInstanceIDAllocated(int guest_instance_id); |
129 // Provided that a guest instance ID has been allocated, this method attaches | 134 // Provided that a guest instance ID has been allocated, this method attaches |
130 // this BrowserPlugin instance to that guest. |extra_params| are parameters | 135 // this BrowserPlugin instance to that guest. |extra_params| are parameters |
131 // passed in by the content embedder to the browser process. | 136 // passed in by the content embedder to the browser process. |
132 void Attach(scoped_ptr<base::DictionaryValue> extra_params); | 137 void Attach(scoped_ptr<base::DictionaryValue> extra_params); |
133 | 138 |
134 // Notify the plugin about a compositor commit so that frame ACKs could be | 139 // Notify the plugin about a compositor commit so that frame ACKs could be |
135 // sent, if needed. | 140 // sent, if needed. |
136 void DidCommitCompositorFrame(); | 141 void DidCommitCompositorFrame(); |
137 | 142 |
138 // Apply opacity settings on the composited layers in embedder and send a | |
139 // message to the guest renderer to enable or disable transparent background. | |
140 void SetContentsOpaque(bool opaque); | |
141 | |
142 // Returns whether a message should be forwarded to BrowserPlugin. | 143 // Returns whether a message should be forwarded to BrowserPlugin. |
143 static bool ShouldForwardToBrowserPlugin(const IPC::Message& message); | 144 static bool ShouldForwardToBrowserPlugin(const IPC::Message& message); |
144 | 145 |
145 // blink::WebPlugin implementation. | 146 // blink::WebPlugin implementation. |
146 virtual blink::WebPluginContainer* container() const OVERRIDE; | 147 virtual blink::WebPluginContainer* container() const OVERRIDE; |
147 virtual bool initialize(blink::WebPluginContainer* container) OVERRIDE; | 148 virtual bool initialize(blink::WebPluginContainer* container) OVERRIDE; |
148 virtual void destroy() OVERRIDE; | 149 virtual void destroy() OVERRIDE; |
149 virtual NPObject* scriptableObject() OVERRIDE; | 150 virtual NPObject* scriptableObject() OVERRIDE; |
150 virtual struct _NPP* pluginNPP() OVERRIDE; | 151 virtual struct _NPP* pluginNPP() OVERRIDE; |
151 virtual bool supportsKeyboardFocus() const OVERRIDE; | 152 virtual bool supportsKeyboardFocus() const OVERRIDE; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 // Maximum size constraint for autosize. | 329 // Maximum size constraint for autosize. |
329 gfx::Size max_auto_size_; | 330 gfx::Size max_auto_size_; |
330 std::string storage_partition_id_; | 331 std::string storage_partition_id_; |
331 bool persist_storage_; | 332 bool persist_storage_; |
332 bool valid_partition_id_; | 333 bool valid_partition_id_; |
333 int content_window_routing_id_; | 334 int content_window_routing_id_; |
334 bool plugin_focused_; | 335 bool plugin_focused_; |
335 // Tracks the visibility of the browser plugin regardless of the whole | 336 // Tracks the visibility of the browser plugin regardless of the whole |
336 // embedder RenderView's visibility. | 337 // embedder RenderView's visibility. |
337 bool visible_; | 338 bool visible_; |
338 // Tracks the opacity of the compositing helper's layers and the guest | |
339 // renderer process. | |
340 bool opaque_; | |
341 | 339 |
342 WebCursor cursor_; | 340 WebCursor cursor_; |
343 | 341 |
344 gfx::Size last_view_size_; | 342 gfx::Size last_view_size_; |
345 bool before_first_navigation_; | 343 bool before_first_navigation_; |
346 bool mouse_locked_; | 344 bool mouse_locked_; |
347 | 345 |
348 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to | 346 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to |
349 // store the BrowserPlugin's BrowserPluginManager in a member variable to | 347 // store the BrowserPlugin's BrowserPluginManager in a member variable to |
350 // avoid accessing the RenderViewImpl. | 348 // avoid accessing the RenderViewImpl. |
(...skipping 14 matching lines...) Expand all Loading... |
365 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 363 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
366 | 364 |
367 std::vector<EditCommand> edit_commands_; | 365 std::vector<EditCommand> edit_commands_; |
368 | 366 |
369 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 367 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
370 }; | 368 }; |
371 | 369 |
372 } // namespace content | 370 } // namespace content |
373 | 371 |
374 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 372 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |