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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit.cc

Issue 6380012: Fix a CHECK failure in AutocompletePopupModel::InfoForCurrentSelection(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Correct solution. Created 9 years, 11 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/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) {

Powered by Google App Engine
This is Rietveld 408576698