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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10411033: Browser Plugin: WebContents should notify when it's restored (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed a test DCHECK Created 8 years, 7 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/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 196095ab2a23d2595b26b7523ccfeb094db0ab9c..25deb92740ad8fa0b0ea209cc915935182ea263a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -47,6 +47,7 @@
#include "content/public/browser/load_notification_details.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_details.h"
#include "content/public/browser/resource_request_details.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -895,10 +896,19 @@ void WebContentsImpl::WasHidden() {
rwhv->WasHidden();
}
+ bool is_visible = false;
content::NotificationService::current()->Notify(
- content::NOTIFICATION_WEB_CONTENTS_HIDDEN,
+ content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
content::Source<WebContents>(this),
- content::NotificationService::NoDetails());
+ content::Details<bool>(&is_visible));
+}
+
+void WebContentsImpl::WasRestored() {
+ bool is_visible = true;
+ content::NotificationService::current()->Notify(
+ content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
+ content::Source<WebContents>(this),
+ content::Details<bool>(&is_visible));
}
void WebContentsImpl::ShowContents() {
@@ -906,6 +916,7 @@ void WebContentsImpl::ShowContents() {
RenderWidgetHostViewPort::FromRWHV(GetRenderWidgetHostView());
if (rwhv)
rwhv->DidBecomeSelected();
+ WasRestored();
}
void WebContentsImpl::HideContents() {

Powered by Google App Engine
This is Rietveld 408576698