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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 551 } |
552 | 552 |
553 void BrowserPlugin::EnableCompositing(bool enable) { | 553 void BrowserPlugin::EnableCompositing(bool enable) { |
554 bool enabled = !!compositing_helper_; | 554 bool enabled = !!compositing_helper_; |
555 if (enabled == enable) | 555 if (enabled == enable) |
556 return; | 556 return; |
557 | 557 |
558 if (enable) { | 558 if (enable) { |
559 DCHECK(!compositing_helper_.get()); | 559 DCHECK(!compositing_helper_.get()); |
560 if (!compositing_helper_.get()) { | 560 if (!compositing_helper_.get()) { |
561 compositing_helper_ = ChildFrameCompositingHelper::CreateForBrowserPlugin( | 561 compositing_helper_ = |
562 weak_ptr_factory_.GetWeakPtr()); | 562 ChildFrameCompositingHelper::CreateCompositingHelperForBrowserPlugin( |
| 563 weak_ptr_factory_.GetWeakPtr()); |
563 } | 564 } |
564 } | 565 } |
565 compositing_helper_->EnableCompositing(enable); | 566 compositing_helper_->EnableCompositing(enable); |
566 compositing_helper_->SetContentsOpaque(!GetAllowTransparencyAttribute()); | 567 compositing_helper_->SetContentsOpaque(!GetAllowTransparencyAttribute()); |
567 | 568 |
568 if (!enable) { | 569 if (!enable) { |
569 DCHECK(compositing_helper_.get()); | 570 DCHECK(compositing_helper_.get()); |
570 compositing_helper_->OnContainerDestroy(); | 571 compositing_helper_->OnContainerDestroy(); |
571 compositing_helper_ = NULL; | 572 compositing_helper_ = NULL; |
572 } | 573 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 const blink::WebMouseEvent& event) { | 964 const blink::WebMouseEvent& event) { |
964 browser_plugin_manager()->Send( | 965 browser_plugin_manager()->Send( |
965 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 966 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
966 guest_instance_id_, | 967 guest_instance_id_, |
967 plugin_rect_, | 968 plugin_rect_, |
968 &event)); | 969 &event)); |
969 return true; | 970 return true; |
970 } | 971 } |
971 | 972 |
972 } // namespace content | 973 } // namespace content |
OLD | NEW |