Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 11066032: Browser Plugin: Update Guest WebContents Visibility on BrowserPlugin Visiblity Change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a test Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
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
OLDNEW
« content/common/browser_plugin_messages.h ('K') | « content/renderer/browser_plugin/browser_plugin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698