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

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

Issue 19197005: Omnibox: Change |inline_autocomplete_offset| to |inline_autocompletion| (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: restore reference, add comments. Created 7 years, 5 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
Index: chrome/browser/ui/omnibox/omnibox_controller.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_controller.cc b/chrome/browser/ui/omnibox/omnibox_controller.cc
index 196fef79714899f3f0c227fff25c393f56b5d3b1..dc6ae2cfd6925dacd9f50a0354e5200e3967d0b2 100644
--- a/chrome/browser/ui/omnibox/omnibox_controller.cc
+++ b/chrome/browser/ui/omnibox/omnibox_controller.cc
@@ -69,21 +69,11 @@ void OmniboxController::OnResultChanged(bool default_match_changed) {
const AutocompleteResult::const_iterator match(result.default_match());
if (match != result.end()) {
current_match_ = *match;
- // TODO(beaudoin): This code could be made simpler if AutocompleteMatch
- // had an |inline_autocompletion| instead of |inline_autocomplete_offset|.
// The |fill_into_edit| we get may not match what we have in the view at
- // that time. We're only interested in the inline_autocomplete part, so
- // update this here.
+ // the time because there is a possibility that the *match prefix differs
+ // from the omnibox content (e.g., swapping spaces for %20). Hence,
+ // we need to replace it.
Peter Kasting 2013/07/16 21:48:50 I'm still confused by all this (sorry). Why is it
beaudoin 2013/07/18 17:50:18 omnibox_edit_model.cc uses current_match() quite a
current_match_.fill_into_edit = omnibox_edit_model_->user_text();
- if (match->inline_autocomplete_offset < match->fill_into_edit.length()) {
- current_match_.inline_autocomplete_offset =
- current_match_.fill_into_edit.length();
- current_match_.fill_into_edit += match->fill_into_edit.substr(
- match->inline_autocomplete_offset);
- } else {
- current_match_.inline_autocomplete_offset = string16::npos;
- }
-
if (!prerender::IsOmniboxEnabled(profile_))
DoPreconnect(*match);
omnibox_edit_model_->OnCurrentMatchChanged();

Powered by Google App Engine
This is Rietveld 408576698