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

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

Issue 214613003: [OriginChip] Show the URL on Esc key pressed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « no previous file | 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 307ba14ddf24350c417df96f8594a44b12f1bd9f..b08886a581dcfb15fe57620e4256d6543f5dfa84 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -501,24 +501,15 @@ void OmniboxEditModel::SetInputInProgress(bool in_progress) {
time_user_first_modified_omnibox_ = base::TimeTicks::Now();
content::RecordAction(base::UserMetricsAction("OmniboxInputInProgress"));
autocomplete_controller()->ResetSession();
- // Once the user starts editing, re-enable URL replacement, so that it will
- // kick in if applicable once the edit is committed or reverted. (While the
- // edit is in progress, this won't have a visible effect.)
- controller_->GetToolbarModel()->set_url_replacement_enabled(true);
Justin Donnelly 2014/03/27 13:47:36 I'm not sure what this was trying to accomplish.
}
- // The following code handles three cases:
+ // The following code handles two cases:
// * For HIDE_ON_USER_INPUT, it hides the chip when user input begins.
// * For HIDE_ON_MOUSE_RELEASE, which only hides the chip on mouse release if
// the omnibox is empty, it handles the "omnibox was not empty" case by
- // acting like HIDE_ON_USER_INPUT. (If the omnibox was empty, it
- // effectively no-ops.)
- // * For both hide behaviors, it allows the chip to be reshown once input
- // ends. (The chip won't actually be re-shown until there's no pending
- // typed navigation; see OriginChipView::ShouldShow() and
- // OriginChipDecoration::ShouldShow().)
- if (chrome::ShouldDisplayOriginChipV2())
- controller()->GetToolbarModel()->set_origin_chip_enabled(!in_progress);
Justin Donnelly 2014/03/27 13:47:36 I don't think there was ever any good reason why I
+ // acting like HIDE_ON_USER_INPUT.
+ if (chrome::ShouldDisplayOriginChipV2() && in_progress)
+ controller()->GetToolbarModel()->set_origin_chip_enabled(false);
controller_->GetToolbarModel()->set_input_in_progress(in_progress);
controller_->Update(NULL);
@@ -986,7 +977,7 @@ bool OmniboxEditModel::OnEscapeKeyPressed() {
OMNIBOX_USER_TEXT_CLEARED_WITH_ESCAPE,
OMNIBOX_USER_TEXT_CLEARED_NUM_OF_ITEMS);
}
- view_->RevertAll();
Justin Donnelly 2014/03/27 13:47:36 As with my first note above, resetting search term
+ view_->RevertWithoutResettingSearchTermReplacement();
view_->SelectAll(true);
return true;
}
« 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