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

Unified Diff: chrome/browser/autofill/autofill_popup_view.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: chrome/browser/autofill/autofill_popup_view.cc
diff --git a/chrome/browser/autofill/autofill_popup_view.cc b/chrome/browser/autofill/autofill_popup_view.cc
index 0a146f5308a410a51698bcef04156a7ee899dac2..0b26b9fa01e85de42dbd2a24cafd6a08a06f0542 100644
--- a/chrome/browser/autofill/autofill_popup_view.cc
+++ b/chrome/browser/autofill/autofill_popup_view.cc
@@ -49,7 +49,7 @@ AutofillPopupView::AutofillPopupView(
return;
registrar_.Add(this,
- content::NOTIFICATION_WEB_CONTENTS_HIDDEN,
+ content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
content::Source<content::WebContents>(web_contents));
registrar_.Add(
this,
@@ -196,7 +196,9 @@ bool AutofillPopupView::HasAutofillEntries() {
void AutofillPopupView::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- if (type == content::NOTIFICATION_WEB_CONTENTS_HIDDEN
- || type == content::NOTIFICATION_NAV_ENTRY_COMMITTED)
+ bool visible = true;
+ if (type == content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED)
+ visible = *content::Details<bool>(details).ptr();
+ if (!visible || type == content::NOTIFICATION_NAV_ENTRY_COMMITTED)
jam 2012/05/18 23:40:51 nit: this code is not that readable. better to mak
Fady Samuel 2012/05/19 15:59:02 Done.
Hide();
}
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_popup_view_browsertest.cc » ('j') | content/public/browser/notification_types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698