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

Unified Diff: chrome/browser/ui/gtk/download/download_started_animation_gtk.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
Index: chrome/browser/ui/gtk/download/download_started_animation_gtk.cc
diff --git a/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc b/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc
index c2781f8d25cdeecb0e9e48c08a42bdac1a9c9642..4a519d58c5b4153cf75871da81bcdde5dfa125a8 100644
--- a/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc
+++ b/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc
@@ -9,6 +9,7 @@
#include <gtk/gtk.h>
#include "base/message_loop.h"
+#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
@@ -106,7 +107,7 @@ DownloadStartedAnimationGtk::DownloadStartedAnimationGtk(
registrar_.Add(
this,
- content::NOTIFICATION_WEB_CONTENTS_HIDDEN,
+ content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
content::Source<WebContents>(web_contents_));
registrar_.Add(
this,
@@ -162,7 +163,7 @@ void DownloadStartedAnimationGtk::Close() {
registrar_.Remove(
this,
- content::NOTIFICATION_WEB_CONTENTS_HIDDEN,
+ content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
content::Source<WebContents>(web_contents_));
registrar_.Remove(
this,
@@ -196,6 +197,11 @@ void DownloadStartedAnimationGtk::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
+ if (type == content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED) {
+ bool visible = *content::Details<bool>(details).ptr();
+ if (visible)
+ return;
+ }
Close();
}

Powered by Google App Engine
This is Rietveld 408576698