Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc |
| index ac4ef1b62c4e61c522d48dde88b813df41f7aa9f..69f598155723daa99441265591f9826d05a49ec7 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin.cc |
| @@ -86,7 +86,6 @@ BrowserPlugin::BrowserPlugin( |
| content_window_routing_id_(MSG_ROUTING_NONE), |
| plugin_focused_(false), |
| visible_(true), |
| - opaque_(true), |
| before_first_navigation_(true), |
| mouse_locked_(false), |
| browser_plugin_manager_(render_view->GetBrowserPluginManager()), |
| @@ -182,6 +181,10 @@ std::string BrowserPlugin::GetNameAttribute() const { |
| return GetDOMAttributeValue(browser_plugin::kAttributeName); |
| } |
| +bool BrowserPlugin::GetAllowTransparencyAttribute() const { |
| + return HasDOMAttribute(browser_plugin::kAttributeAllowTransparency); |
| +} |
| + |
| std::string BrowserPlugin::GetSrcAttribute() const { |
| return GetDOMAttributeValue(browser_plugin::kAttributeSrc); |
| } |
| @@ -259,6 +262,23 @@ void BrowserPlugin::ParseNameAttribute() { |
| GetNameAttribute())); |
| } |
| +void BrowserPlugin::ParseAllowTransparencyAttribute() { |
| + if (!HasGuestInstanceID()) |
| + return; |
| + |
| + bool opaque = !GetAllowTransparencyAttribute(); |
| + |
| + paint_ack_received_ = false; |
|
alexst (slow to review)
2013/11/28 21:44:57
Why did you need to change this?
Fady Samuel
2013/12/02 18:30:04
Experimenting. Forgot to remove it. Removed now.
|
| + |
| + if (compositing_helper_) |
| + compositing_helper_->SetContentsOpaque(opaque); |
| + |
| + browser_plugin_manager()->Send(new BrowserPluginHostMsg_SetContentsOpaque( |
| + render_view_routing_id_, |
| + guest_instance_id_, |
| + opaque)); |
| +} |
| + |
| bool BrowserPlugin::ParseSrcAttribute(std::string* error_message) { |
| if (!valid_partition_id_) { |
| *error_message = browser_plugin::kErrorInvalidPartition; |
| @@ -372,7 +392,7 @@ void BrowserPlugin::Attach(scoped_ptr<base::DictionaryValue> extra_params) { |
| BrowserPluginHostMsg_Attach_Params attach_params; |
| attach_params.focused = ShouldGuestBeFocused(); |
| attach_params.visible = visible_; |
| - attach_params.opaque = opaque_; |
| + attach_params.opaque = !GetAllowTransparencyAttribute(); |
| attach_params.name = GetNameAttribute(); |
| attach_params.storage_partition_id = storage_partition_id_; |
| attach_params.persist_storage = persist_storage_; |
| @@ -393,23 +413,6 @@ void BrowserPlugin::DidCommitCompositorFrame() { |
| compositing_helper_->DidCommitCompositorFrame(); |
| } |
| -void BrowserPlugin::SetContentsOpaque(bool opaque) { |
| - if (opaque_ == opaque) |
| - return; |
| - |
| - opaque_ = opaque; |
| - if (!HasGuestInstanceID()) |
| - return; |
| - |
| - if (compositing_helper_) |
| - compositing_helper_->SetContentsOpaque(opaque_); |
| - |
| - browser_plugin_manager()->Send(new BrowserPluginHostMsg_SetContentsOpaque( |
| - render_view_routing_id_, |
| - guest_instance_id_, |
| - opaque_)); |
| -} |
| - |
| void BrowserPlugin::OnAdvanceFocus(int guest_instance_id, bool reverse) { |
| DCHECK(render_view_.get()); |
| render_view_->GetWebView()->advanceFocus(reverse); |
| @@ -918,7 +921,7 @@ void BrowserPlugin::EnableCompositing(bool enable) { |
| } |
| } |
| compositing_helper_->EnableCompositing(enable); |
| - compositing_helper_->SetContentsOpaque(opaque_); |
| + compositing_helper_->SetContentsOpaque(!GetAllowTransparencyAttribute()); |
| } |
| void BrowserPlugin::destroy() { |