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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/autocomplete/autocomplete_edit.h" 5 #include "chrome/browser/autocomplete/autocomplete_edit.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 paste_state_ = NONE; 481 paste_state_ = NONE;
482 482
483 // Like typing, killing focus "accepts" the temporary text as the user 483 // Like typing, killing focus "accepts" the temporary text as the user
484 // text, because it makes little sense to have temporary text when the 484 // text, because it makes little sense to have temporary text when the
485 // popup is closed. 485 // popup is closed.
486 InternalSetUserText(UserTextFromDisplayText(view_->GetText())); 486 InternalSetUserText(UserTextFromDisplayText(view_->GetText()));
487 has_temporary_text_ = false; 487 has_temporary_text_ = false;
488 } 488 }
489 489
490 bool AutocompleteEditModel::OnEscapeKeyPressed() { 490 bool AutocompleteEditModel::OnEscapeKeyPressed() {
491 if (has_temporary_text_) { 491 if (has_temporary_text_ && popup_->IsOpen()) {
Peter Kasting 2011/01/21 23:58:15 It should be an invariant here that the popup is o
492 AutocompleteMatch match; 492 AutocompleteMatch match;
493 popup_->InfoForCurrentSelection(&match, NULL); 493 popup_->InfoForCurrentSelection(&match, NULL);
494 if (match.destination_url != original_url_) { 494 if (match.destination_url != original_url_) {
495 // The user typed something, then selected a different item. Restore the 495 // The user typed something, then selected a different item. Restore the
496 // text they typed and change back to the default item. 496 // text they typed and change back to the default item.
497 // NOTE: This purposefully does not reset paste_state_. 497 // NOTE: This purposefully does not reset paste_state_.
498 just_deleted_text_ = false; 498 just_deleted_text_ = false;
499 has_temporary_text_ = false; 499 has_temporary_text_ = false;
500 popup_->ResetToDefaultMatch(); 500 popup_->ResetToDefaultMatch();
501 view_->OnRevertTemporaryText(); 501 view_->OnRevertTemporaryText();
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 // static 793 // static
794 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { 794 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) {
795 switch (c) { 795 switch (c) {
796 case 0x0020: // Space 796 case 0x0020: // Space
797 case 0x3000: // Ideographic Space 797 case 0x3000: // Ideographic Space
798 return true; 798 return true;
799 default: 799 default:
800 return false; 800 return false;
801 } 801 }
802 } 802 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698