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 b65256c27f1fce7233363df7a66a376a1daa98d8..d470801eb6667279c79734097e1488e0357222c4 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -47,7 +47,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); |
@@ -135,6 +136,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(); |
+} |
+ |
WebContents* BrowserPluginGuest::GetWebContents() { |
return web_contents(); |
} |