Chromium Code Reviews| 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(); |
| } |