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

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

Issue 23804002: Make OmniboxEditModel::UpdatePermanentText() fetch the new text itself rather (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 4 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 | « chrome/browser/ui/omnibox/omnibox_edit_model.h ('k') | chrome/browser/ui/omnibox/omnibox_edit_unittest.cc » ('j') | 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
===================================================================
--- chrome/browser/ui/omnibox/omnibox_edit_model.cc (revision 220446)
+++ chrome/browser/ui/omnibox/omnibox_edit_model.cc (working copy)
@@ -251,7 +251,7 @@
return match;
}
-bool OmniboxEditModel::UpdatePermanentText(const string16& new_permanent_text) {
+bool OmniboxEditModel::UpdatePermanentText() {
// When there's a new URL, and the user is not editing anything or the edit
// doesn't have focus, we want to revert the edit to show the new URL. (The
// common case where the edit doesn't have focus is when the user has started
@@ -263,6 +263,7 @@
// process -- before and after the auto-commit, the omnibox should show the
// same user text and the same instant suggestion, even if the auto-commit
// happens while the edit doesn't have focus.
+ string16 new_permanent_text = controller_->GetToolbarModel()->GetText(true);
string16 gray_text = view_->GetGrayTextAutocompletion();
const bool visibly_changed_permanent_text =
(permanent_text_ != new_permanent_text) &&
@@ -724,7 +725,7 @@
if (disposition != NEW_BACKGROUND_TAB) {
base::AutoReset<bool> tmp(&in_revert_, true);
- view_->RevertAll(); // Revert the box to its unedited state
+ view_->RevertAll(); // Revert the box to its unedited state.
}
if (match.type == AutocompleteMatchType::EXTENSION_APP) {
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_edit_model.h ('k') | chrome/browser/ui/omnibox/omnibox_edit_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698