Chromium Code Reviews| 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(); |