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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 716801735cdce5efdc43cda24884a5fad9e2872a..857a55256889462ca34f4262d8164607182763f5 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -43,7 +43,8 @@ BrowserPluginGuest::BrowserPluginGuest(int instance_id,
damage_buffer_scale_factor_(1.0f),
pending_update_counter_(0),
guest_hang_timeout_(
- base::TimeDelta::FromMilliseconds(kGuestHangTimeoutMs)) {
+ base::TimeDelta::FromMilliseconds(kGuestHangTimeoutMs)),
+ visible_(true) {
DCHECK(web_contents);
// |render_view_host| manages the ownership of this BrowserPluginGuestHelper.
new BrowserPluginGuestHelper(this, render_view_host);
@@ -98,6 +99,14 @@ void BrowserPluginGuest::SetIsAcceptingTouchEvents(bool accept) {
new BrowserPluginMsg_ShouldAcceptTouchEvents(instance_id(), accept));
}
+void BrowserPluginGuest::SetVisibility(bool embedder_visible, bool visible) {
+ visible_ = visible;
+ if (embedder_visible && visible)
+ web_contents()->WasShown();
+ else
+ web_contents()->WasHidden();
Charlie Reis 2012/10/05 00:33:18 Just to be clear, does this notify the guest rende
Fady Samuel 2012/10/05 15:22:07 Done.
+}
+
WebContents* BrowserPluginGuest::GetWebContents() {
return web_contents();
}

Powered by Google App Engine
This is Rietveld 408576698