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 #include "content/renderer/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 } | 540 } |
541 | 541 |
542 void BrowserPlugin::EnableCompositing(bool enable) { | 542 void BrowserPlugin::EnableCompositing(bool enable) { |
543 bool enabled = !!compositing_helper_; | 543 bool enabled = !!compositing_helper_; |
544 if (enabled == enable) | 544 if (enabled == enable) |
545 return; | 545 return; |
546 | 546 |
547 if (enable) { | 547 if (enable) { |
548 DCHECK(!compositing_helper_.get()); | 548 DCHECK(!compositing_helper_.get()); |
549 if (!compositing_helper_.get()) { | 549 if (!compositing_helper_.get()) { |
550 compositing_helper_ = | 550 compositing_helper_ = ChildFrameCompositingHelper::CreateForBrowserPlugin( |
551 ChildFrameCompositingHelper::CreateCompositingHelperForBrowserPlugin( | 551 weak_ptr_factory_.GetWeakPtr()); |
552 weak_ptr_factory_.GetWeakPtr()); | |
553 } | 552 } |
554 } | 553 } |
555 compositing_helper_->EnableCompositing(enable); | 554 compositing_helper_->EnableCompositing(enable); |
556 compositing_helper_->SetContentsOpaque(!GetAllowTransparencyAttribute()); | 555 compositing_helper_->SetContentsOpaque(!GetAllowTransparencyAttribute()); |
557 | 556 |
558 if (!enable) { | 557 if (!enable) { |
559 DCHECK(compositing_helper_.get()); | 558 DCHECK(compositing_helper_.get()); |
560 compositing_helper_->OnContainerDestroy(); | 559 compositing_helper_->OnContainerDestroy(); |
561 compositing_helper_ = NULL; | 560 compositing_helper_ = NULL; |
562 } | 561 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 const blink::WebMouseEvent& event) { | 952 const blink::WebMouseEvent& event) { |
954 browser_plugin_manager()->Send( | 953 browser_plugin_manager()->Send( |
955 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 954 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
956 guest_instance_id_, | 955 guest_instance_id_, |
957 plugin_rect_, | 956 plugin_rect_, |
958 &event)); | 957 &event)); |
959 return true; | 958 return true; |
960 } | 959 } |
961 | 960 |
962 } // namespace content | 961 } // namespace content |
OLD | NEW |