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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 12288046: Merge 182751 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 years, 10 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/autofill/autofill_popup_controller_impl.cc
===================================================================
--- chrome/browser/ui/autofill/autofill_popup_controller_impl.cc (revision 183209)
+++ chrome/browser/ui/autofill/autofill_popup_controller_impl.cc (working copy)
@@ -104,7 +104,6 @@
selected_line_(kNoSelection),
delete_icon_hovered_(false),
is_hiding_(false),
- inform_delegate_of_destruction_(true),
weak_ptr_factory_(this) {
#if !defined(OS_ANDROID)
subtext_font_ = name_font_.DeriveFont(kLabelFontSizeDelta);
@@ -171,8 +170,18 @@
}
void AutofillPopupControllerImpl::Hide() {
- inform_delegate_of_destruction_ = false;
- HideInternal();
+ if (is_hiding_)
+ return;
+ is_hiding_ = true;
+
+ SetSelectedLine(kNoSelection);
+
+ delegate_->OnPopupHidden(this);
+
+ if (view_)
+ view_->Hide();
+ else
+ delete this;
}
bool AutofillPopupControllerImpl::HandleKeyPressEvent(
@@ -191,7 +200,7 @@
SetSelectedLine(names().size() - 1);
return true;
case ui::VKEY_ESCAPE:
- HideInternal();
+ Hide();
return true;
case ui::VKEY_DELETE:
return (event.modifiers & content::NativeWebKeyboardEvent::ShiftKey) &&
@@ -333,22 +342,6 @@
return delete_icon_hovered_;
}
-void AutofillPopupControllerImpl::HideInternal() {
- if (is_hiding_)
- return;
- is_hiding_ = true;
-
- SetSelectedLine(kNoSelection);
-
- if (inform_delegate_of_destruction_)
- delegate_->OnPopupHidden(this);
-
- if (view_)
- view_->Hide();
- else
- delete this;
-}
-
void AutofillPopupControllerImpl::SetSelectedLine(int selected_line) {
if (selected_line_ == selected_line)
return;
@@ -437,7 +430,7 @@
delegate_->ClearPreviewedForm();
UpdateBoundsAndRedrawPopup();
} else {
- HideInternal();
+ Hide();
}
return true;

Powered by Google App Engine
This is Rietveld 408576698