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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 const WebPluginParams& params) | 61 const WebPluginParams& params) |
62 : instance_id_(instance_id), | 62 : instance_id_(instance_id), |
63 render_view_(render_view), | 63 render_view_(render_view), |
64 container_(NULL), | 64 container_(NULL), |
65 damage_buffer_(NULL), | 65 damage_buffer_(NULL), |
66 sad_guest_(NULL), | 66 sad_guest_(NULL), |
67 guest_crashed_(false), | 67 guest_crashed_(false), |
68 resize_pending_(false), | 68 resize_pending_(false), |
69 navigate_src_sent_(false), | 69 navigate_src_sent_(false), |
70 process_id_(-1), | 70 process_id_(-1), |
71 persist_storage_(false) { | 71 persist_storage_(false), |
72 visible_(true) { | |
72 BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); | 73 BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); |
73 bindings_.reset(new BrowserPluginBindings(this)); | 74 bindings_.reset(new BrowserPluginBindings(this)); |
74 | 75 |
75 ParseAttributes(params); | 76 ParseAttributes(params); |
76 } | 77 } |
77 | 78 |
78 BrowserPlugin::~BrowserPlugin() { | 79 BrowserPlugin::~BrowserPlugin() { |
79 if (damage_buffer_) | 80 if (damage_buffer_) |
80 FreeDamageBuffer(); | 81 FreeDamageBuffer(); |
81 RemoveEventListeners(); | 82 RemoveEventListeners(); |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
641 } | 642 } |
642 | 643 |
643 void BrowserPlugin::updateFocus(bool focused) { | 644 void BrowserPlugin::updateFocus(bool focused) { |
644 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( | 645 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( |
645 render_view_->GetRoutingID(), | 646 render_view_->GetRoutingID(), |
646 instance_id_, | 647 instance_id_, |
647 focused)); | 648 focused)); |
648 } | 649 } |
649 | 650 |
650 void BrowserPlugin::updateVisibility(bool visible) { | 651 void BrowserPlugin::updateVisibility(bool visible) { |
652 if (visible_ == visible) | |
Charlie Reis
2012/10/05 00:33:18
Just confirming: we don't need to care if the embe
| |
653 return; | |
654 | |
655 visible_ = visible; | |
656 if (!navigate_src_sent_) | |
657 return; | |
658 | |
659 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( | |
660 render_view_->GetRoutingID(), | |
661 instance_id_, | |
662 visible)); | |
651 } | 663 } |
652 | 664 |
653 bool BrowserPlugin::acceptsInputEvents() { | 665 bool BrowserPlugin::acceptsInputEvents() { |
654 return true; | 666 return true; |
655 } | 667 } |
656 | 668 |
657 bool BrowserPlugin::handleInputEvent(const WebKit::WebInputEvent& event, | 669 bool BrowserPlugin::handleInputEvent(const WebKit::WebInputEvent& event, |
658 WebKit::WebCursorInfo& cursor_info) { | 670 WebKit::WebCursorInfo& cursor_info) { |
659 if (guest_crashed_ || !navigate_src_sent_) | 671 if (guest_crashed_ || !navigate_src_sent_) |
660 return false; | 672 return false; |
(...skipping 30 matching lines...) Expand all Loading... | |
691 void* notify_data) { | 703 void* notify_data) { |
692 } | 704 } |
693 | 705 |
694 void BrowserPlugin::didFailLoadingFrameRequest( | 706 void BrowserPlugin::didFailLoadingFrameRequest( |
695 const WebKit::WebURL& url, | 707 const WebKit::WebURL& url, |
696 void* notify_data, | 708 void* notify_data, |
697 const WebKit::WebURLError& error) { | 709 const WebKit::WebURLError& error) { |
698 } | 710 } |
699 | 711 |
700 } // namespace content | 712 } // namespace content |
OLD | NEW |