Commit 52179c1b authored by scheib's avatar scheib Committed by Commit bot

Revert of Allow users to perform queries in the omnibox which begin with a...

Revert of Allow users to perform queries in the omnibox which begin with a search shortcut. (patchset #4 id:60001 of https://codereview.chromium.org/477873002/)

Reason for revert:
Caused a few OmniboxViewTest interactive_ui_tests failures (tests need updating too).

build:
http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/22466

test output:
https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/501/steps/interactive_ui_tests/logs/OmniboxViewTest.AcceptKeywordBySpace

Looks like try jobs weren't run, only commit queue earlier. Unsure why commit queue didn't include this test - but it's recommended to run 'git cl try' on patches and review.

Original issue's description:
> Allow users to perform queries in the omnibox which begin with a search
> shortcut.
>
> Previously, if a user had (for example) configured a search shortcut of 'cs' which
> went to cs.chromium.org, they would be unable to (easily) start a query in the
> omnibox starting with 'cs'. Now, backspacing the keyword leaves the space after
> the keyword, allowing the user to continue typing without reenabling keyword
> mode.
>
> BUG=393371
> NOTRY=true
> R=pkasting@chromium.org
> TEST=type 'google.com ' into the omnibar and it should enter keyword mode.
> Press backspace and 'google.com ' will be left in the omnibar, rather than
> 'google.com'.
>
> Committed: https://crrev.com/709649607f13acb04e3850d5fd7fc1903c1becae
> Cr-Commit-Position: refs/heads/master@{#322429}

TBR=pkasting@chromium.org,sky@chromium.org,lenny.khazan@gmail.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=393371

Review URL: https://codereview.chromium.org/1030413002

Cr-Commit-Position: refs/heads/master@{#322448}
parent ab29ef03
......@@ -291,7 +291,6 @@ Laszlo Radanyi <bekkra@gmail.com>
Lauren Yeun Kim <lauren.yeun.kim@gmail.com>
Lauri Oherd <lauri.oherd@gmail.com>
Leith Bade <leith@leithalweapon.geek.nz>
Lenny Khazan <lenny.khazan@gmail.com>
Li Yin <li.yin@intel.com>
Lidwine Genevet <lgenevet@cisco.com>
Lionel Landwerlin <lionel.g.landwerlin@intel.com>
......
......@@ -880,17 +880,14 @@ void OmniboxEditModel::ClearKeyword(const base::string16& visible_text) {
autocomplete_controller()->Stop(false);
omnibox_controller_->ClearPopupKeywordMode();
// 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;
const base::string16 window_text(keyword_ + 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() + 1,
view_->SetWindowTextAndCaretPos(window_text.c_str(), keyword_.length(),
false, false);
keyword_.clear();
is_keyword_hint_ = false;
......@@ -900,7 +897,7 @@ void OmniboxEditModel::ClearKeyword(const base::string16& visible_text) {
// longer.
} else {
is_keyword_hint_ = true;
view_->SetWindowTextAndCaretPos(window_text.c_str(), keyword_.length() + 1,
view_->SetWindowTextAndCaretPos(window_text.c_str(), keyword_.length(),
false, true);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment