OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #if defined (OS_WIN) | 9 #if defined (OS_WIN) |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const WebPluginParams& params) | 64 const WebPluginParams& params) |
65 : instance_id_(instance_id), | 65 : instance_id_(instance_id), |
66 render_view_(render_view), | 66 render_view_(render_view), |
67 container_(NULL), | 67 container_(NULL), |
68 damage_buffer_(NULL), | 68 damage_buffer_(NULL), |
69 sad_guest_(NULL), | 69 sad_guest_(NULL), |
70 guest_crashed_(false), | 70 guest_crashed_(false), |
71 resize_pending_(false), | 71 resize_pending_(false), |
72 navigate_src_sent_(false), | 72 navigate_src_sent_(false), |
73 process_id_(-1), | 73 process_id_(-1), |
74 persist_storage_(false) { | 74 persist_storage_(false), |
| 75 visible_(true) { |
75 BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); | 76 BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); |
76 bindings_.reset(new BrowserPluginBindings(this)); | 77 bindings_.reset(new BrowserPluginBindings(this)); |
77 | 78 |
78 ParseAttributes(params); | 79 ParseAttributes(params); |
79 } | 80 } |
80 | 81 |
81 BrowserPlugin::~BrowserPlugin() { | 82 BrowserPlugin::~BrowserPlugin() { |
82 if (damage_buffer_) | 83 if (damage_buffer_) |
83 FreeDamageBuffer(); | 84 FreeDamageBuffer(); |
84 RemoveEventListeners(); | 85 RemoveEventListeners(); |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 } | 679 } |
679 | 680 |
680 void BrowserPlugin::updateFocus(bool focused) { | 681 void BrowserPlugin::updateFocus(bool focused) { |
681 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( | 682 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( |
682 render_view_->GetRoutingID(), | 683 render_view_->GetRoutingID(), |
683 instance_id_, | 684 instance_id_, |
684 focused)); | 685 focused)); |
685 } | 686 } |
686 | 687 |
687 void BrowserPlugin::updateVisibility(bool visible) { | 688 void BrowserPlugin::updateVisibility(bool visible) { |
| 689 if (visible_ == visible) |
| 690 return; |
| 691 |
| 692 visible_ = visible; |
| 693 if (!navigate_src_sent_) |
| 694 return; |
| 695 |
| 696 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( |
| 697 render_view_->GetRoutingID(), |
| 698 instance_id_, |
| 699 visible)); |
688 } | 700 } |
689 | 701 |
690 bool BrowserPlugin::acceptsInputEvents() { | 702 bool BrowserPlugin::acceptsInputEvents() { |
691 return true; | 703 return true; |
692 } | 704 } |
693 | 705 |
694 bool BrowserPlugin::handleInputEvent(const WebKit::WebInputEvent& event, | 706 bool BrowserPlugin::handleInputEvent(const WebKit::WebInputEvent& event, |
695 WebKit::WebCursorInfo& cursor_info) { | 707 WebKit::WebCursorInfo& cursor_info) { |
696 if (guest_crashed_ || !navigate_src_sent_) | 708 if (guest_crashed_ || !navigate_src_sent_) |
697 return false; | 709 return false; |
(...skipping 30 matching lines...) Expand all Loading... |
728 void* notify_data) { | 740 void* notify_data) { |
729 } | 741 } |
730 | 742 |
731 void BrowserPlugin::didFailLoadingFrameRequest( | 743 void BrowserPlugin::didFailLoadingFrameRequest( |
732 const WebKit::WebURL& url, | 744 const WebKit::WebURL& url, |
733 void* notify_data, | 745 void* notify_data, |
734 const WebKit::WebURLError& error) { | 746 const WebKit::WebURLError& error) { |
735 } | 747 } |
736 | 748 |
737 } // namespace content | 749 } // namespace content |
OLD | NEW |