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 12f9848cd42ab4f96f90801751bda7a485bd332f..ea82b4c33c5e133333b047de6f5405e6b668b8d1 100644 |
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc |
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc |
@@ -880,14 +880,17 @@ void OmniboxEditModel::ClearKeyword(const base::string16& visible_text) { |
autocomplete_controller()->Stop(false); |
omnibox_controller_->ClearPopupKeywordMode(); |
- const base::string16 window_text(keyword_ + visible_text); |
+ // Add a space after the keyword to allow the user to continue typing without |
+ // re-enabling keyword mode. |
+ const base::string16 window_text = |
+ keyword_ + base::ASCIIToUTF16(" ") + visible_text; |
// Only reset the result if the edit text has changed since the |
// keyword was accepted, or if the popup is closed. |
if (just_deleted_text_ || !visible_text.empty() || |
!(popup_model() && popup_model()->IsOpen())) { |
view_->OnBeforePossibleChange(); |
- view_->SetWindowTextAndCaretPos(window_text.c_str(), keyword_.length(), |
+ view_->SetWindowTextAndCaretPos(window_text.c_str(), keyword_.length() + 1, |
false, false); |
keyword_.clear(); |
is_keyword_hint_ = false; |
@@ -897,7 +900,7 @@ void OmniboxEditModel::ClearKeyword(const base::string16& visible_text) { |
// longer. |
} else { |
is_keyword_hint_ = true; |
- view_->SetWindowTextAndCaretPos(window_text.c_str(), keyword_.length(), |
+ view_->SetWindowTextAndCaretPos(window_text.c_str(), keyword_.length() + 1, |
false, true); |
} |