| Index: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
|
| diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
|
| index 7f3634768c87351958759ee79d44b5e3f5dbce30..46e12fb0c0e0551d2c992cdc798039af5d67936c 100644
|
| --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
|
| +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
|
| @@ -103,7 +103,7 @@ AutofillPopupControllerImpl::AutofillPopupControllerImpl(
|
| element_bounds_(element_bounds),
|
| selected_line_(kNoSelection),
|
| delete_icon_hovered_(false),
|
| - is_hiding_(false),
|
| + hide_called_(false),
|
| weak_ptr_factory_(this) {
|
| #if !defined(OS_ANDROID)
|
| subtext_font_ = name_font_.DeriveFont(kLabelFontSizeDelta);
|
| @@ -111,7 +111,9 @@ AutofillPopupControllerImpl::AutofillPopupControllerImpl(
|
| #endif
|
| }
|
|
|
| -AutofillPopupControllerImpl::~AutofillPopupControllerImpl() {}
|
| +AutofillPopupControllerImpl::~AutofillPopupControllerImpl() {
|
| + CHECK(hide_called_);
|
| +}
|
|
|
| void AutofillPopupControllerImpl::Show(
|
| const std::vector<string16>& names,
|
| @@ -170,9 +172,7 @@ void AutofillPopupControllerImpl::Show(
|
| }
|
|
|
| void AutofillPopupControllerImpl::Hide() {
|
| - if (is_hiding_)
|
| - return;
|
| - is_hiding_ = true;
|
| + hide_called_ = true;
|
|
|
| SetSelectedLine(kNoSelection);
|
|
|
| @@ -180,8 +180,8 @@ void AutofillPopupControllerImpl::Hide() {
|
|
|
| if (view_)
|
| view_->Hide();
|
| - else
|
| - delete this;
|
| +
|
| + delete this;
|
| }
|
|
|
| bool AutofillPopupControllerImpl::HandleKeyPressEvent(
|
| @@ -212,10 +212,6 @@ bool AutofillPopupControllerImpl::HandleKeyPressEvent(
|
| }
|
| }
|
|
|
| -void AutofillPopupControllerImpl::ViewDestroyed() {
|
| - delete this;
|
| -}
|
| -
|
| void AutofillPopupControllerImpl::UpdateBoundsAndRedrawPopup() {
|
| #if !defined(OS_ANDROID)
|
| // TODO(csharp): Since UpdatePopupBounds can change the position of the popup,
|
|
|