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. | |
alexst (slow to review)
2013/12/02 19:03:24
Describe this a bit better since this sends an IPC
| |
66 void ParseAllowTransparencyAttribute(); | |
63 // Get the src attribute value of the BrowserPlugin instance. | 67 // Get the src attribute value of the BrowserPlugin instance. |
64 std::string GetSrcAttribute() const; | 68 std::string GetSrcAttribute() const; |
65 // Parse the src attribute value of the BrowserPlugin instance. | 69 // Parse the src attribute value of the BrowserPlugin instance. |
66 bool ParseSrcAttribute(std::string* error_message); | 70 bool ParseSrcAttribute(std::string* error_message); |
67 // Get the autosize attribute value. | 71 // Get the autosize attribute value. |
68 bool GetAutoSizeAttribute() const; | 72 bool GetAutoSizeAttribute() const; |
69 // Parses the autosize attribute value. | 73 // Parses the autosize attribute value. |
70 void ParseAutoSizeAttribute(); | 74 void ParseAutoSizeAttribute(); |
71 // Get the maxheight attribute value. | 75 // Get the maxheight attribute value. |
72 int GetMaxHeightAttribute() const; | 76 int GetMaxHeightAttribute() const; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 void OnInstanceIDAllocated(int guest_instance_id); | 132 void OnInstanceIDAllocated(int guest_instance_id); |
129 // Provided that a guest instance ID has been allocated, this method attaches | 133 // Provided that a guest instance ID has been allocated, this method attaches |
130 // this BrowserPlugin instance to that guest. |extra_params| are parameters | 134 // this BrowserPlugin instance to that guest. |extra_params| are parameters |
131 // passed in by the content embedder to the browser process. | 135 // passed in by the content embedder to the browser process. |
132 void Attach(scoped_ptr<base::DictionaryValue> extra_params); | 136 void Attach(scoped_ptr<base::DictionaryValue> extra_params); |
133 | 137 |
134 // Notify the plugin about a compositor commit so that frame ACKs could be | 138 // Notify the plugin about a compositor commit so that frame ACKs could be |
135 // sent, if needed. | 139 // sent, if needed. |
136 void DidCommitCompositorFrame(); | 140 void DidCommitCompositorFrame(); |
137 | 141 |
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. | 142 // Returns whether a message should be forwarded to BrowserPlugin. |
143 static bool ShouldForwardToBrowserPlugin(const IPC::Message& message); | 143 static bool ShouldForwardToBrowserPlugin(const IPC::Message& message); |
144 | 144 |
145 // blink::WebPlugin implementation. | 145 // blink::WebPlugin implementation. |
146 virtual blink::WebPluginContainer* container() const OVERRIDE; | 146 virtual blink::WebPluginContainer* container() const OVERRIDE; |
147 virtual bool initialize(blink::WebPluginContainer* container) OVERRIDE; | 147 virtual bool initialize(blink::WebPluginContainer* container) OVERRIDE; |
148 virtual void destroy() OVERRIDE; | 148 virtual void destroy() OVERRIDE; |
149 virtual NPObject* scriptableObject() OVERRIDE; | 149 virtual NPObject* scriptableObject() OVERRIDE; |
150 virtual struct _NPP* pluginNPP() OVERRIDE; | 150 virtual struct _NPP* pluginNPP() OVERRIDE; |
151 virtual bool supportsKeyboardFocus() const OVERRIDE; | 151 virtual bool supportsKeyboardFocus() const OVERRIDE; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 // Maximum size constraint for autosize. | 328 // Maximum size constraint for autosize. |
329 gfx::Size max_auto_size_; | 329 gfx::Size max_auto_size_; |
330 std::string storage_partition_id_; | 330 std::string storage_partition_id_; |
331 bool persist_storage_; | 331 bool persist_storage_; |
332 bool valid_partition_id_; | 332 bool valid_partition_id_; |
333 int content_window_routing_id_; | 333 int content_window_routing_id_; |
334 bool plugin_focused_; | 334 bool plugin_focused_; |
335 // Tracks the visibility of the browser plugin regardless of the whole | 335 // Tracks the visibility of the browser plugin regardless of the whole |
336 // embedder RenderView's visibility. | 336 // embedder RenderView's visibility. |
337 bool visible_; | 337 bool visible_; |
338 // Tracks the opacity of the compositing helper's layers and the guest | |
339 // renderer process. | |
340 bool opaque_; | |
341 | 338 |
342 WebCursor cursor_; | 339 WebCursor cursor_; |
343 | 340 |
344 gfx::Size last_view_size_; | 341 gfx::Size last_view_size_; |
345 bool before_first_navigation_; | 342 bool before_first_navigation_; |
346 bool mouse_locked_; | 343 bool mouse_locked_; |
347 | 344 |
348 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to | 345 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to |
349 // store the BrowserPlugin's BrowserPluginManager in a member variable to | 346 // store the BrowserPlugin's BrowserPluginManager in a member variable to |
350 // avoid accessing the RenderViewImpl. | 347 // avoid accessing the RenderViewImpl. |
(...skipping 14 matching lines...) Expand all Loading... | |
365 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 362 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
366 | 363 |
367 std::vector<EditCommand> edit_commands_; | 364 std::vector<EditCommand> edit_commands_; |
368 | 365 |
369 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 366 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
370 }; | 367 }; |
371 | 368 |
372 } // namespace content | 369 } // namespace content |
373 | 370 |
374 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 371 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |