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

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: Fixed nits 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 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();
}

Powered by Google App Engine
This is Rietveld 408576698