Index: chrome/browser/autocomplete/autocomplete_edit.cc |
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc |
index 1ad993eeb638778287a9157989000b414948c009..3b8ec9b3ea913739b4a1c8497b9ec29be624035b 100644 |
--- a/chrome/browser/autocomplete/autocomplete_edit.cc |
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc |
@@ -479,12 +479,6 @@ void AutocompleteEditModel::OnKillFocus() { |
has_focus_ = false; |
control_key_state_ = UP; |
paste_state_ = NONE; |
- |
- // Like typing, killing focus "accepts" the temporary text as the user |
- // text, because it makes little sense to have temporary text when the |
- // popup is closed. |
- InternalSetUserText(UserTextFromDisplayText(view_->GetText())); |
- has_temporary_text_ = false; |
} |
bool AutocompleteEditModel::OnEscapeKeyPressed() { |
@@ -680,6 +674,13 @@ void AutocompleteEditModel::PopupBoundsChangedTo(const gfx::Rect& bounds) { |
controller_->OnPopupBoundsChanged(bounds); |
} |
+void AutocompleteEditModel::OnPopupClosed() { |
+ // Accepts the temporary text as the user text, because it makes little |
+ // sense to have temporary text when the popup is closed. |
+ InternalSetUserText(UserTextFromDisplayText(view_->GetText())); |
+ has_temporary_text_ = false; |
+} |
+ |
// Return true if the suggestion type warrants a TCP/IP preconnection. |
// i.e., it is now highly likely that the user will select the related domain. |
static bool IsPreconnectable(AutocompleteMatch::Type type) { |