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

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: 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..19f59cf82bc907b98757584a38a1276ae96727b5 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -883,10 +883,16 @@ 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_)) {
Peter Kasting 2012/10/02 07:37:12 Does this do the right thing in cases where we hav
Joe Thomas 2012/10/02 18:39:23 When keyword search mode is activated, AFAIK there
Peter Kasting 2012/10/02 18:42:35 We can definitely inline autocomplete while in key
Joe Thomas 2012/10/02 18:57:24 Yes, you are right. The patch breaks that usecase.
+ view_->SetWindowTextAndCaretPos(DisplayTextFromUserText(user_text_), 0,
+ 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