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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 11034019: Cursor jumps to end of omnibox when activating keyword mode via inserted space (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed inline autocompletion issue in keyword search mode Created 8 years, 2 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
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index 8232aae8b8de4a26080de0f111343c22d7212a14..9c795d06cd2163d7a91a2c49b72967a0045c023f 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -883,10 +883,17 @@ void OmniboxEditModel::OnPopupDataChanged(
bool call_controller_onchanged = true;
inline_autocomplete_text_ = text;
- if (view_->OnInlineAutocompleteTextMaybeChanged(
- DisplayTextFromUserText(user_text_ + inline_autocomplete_text_),
- DisplayTextFromUserText(user_text_).length()))
+ if (KeywordIsSelected() &&
+ view_->GetText() != DisplayTextFromUserText(user_text_) &&
+ inline_autocomplete_text_.empty()) {
+ view_->SetWindowTextAndCaretPos(DisplayTextFromUserText(user_text_), 0,
Peter Kasting 2012/10/02 21:52:02 This still feels kind of wrong to me. Where does
Joe Thomas 2012/10/02 22:11:34 The existing code which changes the display text i
Peter Kasting 2012/10/02 22:38:28 This just doesn't seem like the right place to be
Joe Thomas 2012/10/03 01:59:47 I doubt I completely understand your logic from yo
Peter Kasting 2012/10/03 03:01:01 Yes, I understood all that. I've just spent anoth
Joe Thomas 2012/10/03 05:41:12 Thanks for the detailed review. I will make the re
+ false, true);
+ call_controller_onchanged = false;
+ } else if (view_->OnInlineAutocompleteTextMaybeChanged(
+ DisplayTextFromUserText(user_text_ + inline_autocomplete_text_),
+ DisplayTextFromUserText(user_text_).length())) {
call_controller_onchanged = false;
+ }
// If |has_temporary_text_| is true, then we previously had a manual selection
// but now don't (or |destination_for_temporary_text_change| would have been
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698