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

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: Merged with ToT 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f5b8f4037ec7fce3f1f1a0c20507f378d44ed656..751a13322bcd7a9697ec1f25da688b11d3f82245 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"
@@ -901,10 +902,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() {
@@ -912,6 +922,7 @@ void WebContentsImpl::ShowContents() {
RenderWidgetHostViewPort::FromRWHV(GetRenderWidgetHostView());
if (rwhv)
rwhv->DidBecomeSelected();
+ WasRestored();
}
void WebContentsImpl::HideContents() {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698