| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/omnibox/history_quick_provider.h" | 5 #include "components/omnibox/history_quick_provider.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // |fill_into_edit| if the user has typed an URL with a scheme and the | 256 // |fill_into_edit| if the user has typed an URL with a scheme and the |
| 257 // last character typed is a slash. That slash is removed by the | 257 // last character typed is a slash. That slash is removed by the |
| 258 // FormatURLWithOffsets call above. | 258 // FormatURLWithOffsets call above. |
| 259 if (inline_autocomplete_offset < match.fill_into_edit.length()) { | 259 if (inline_autocomplete_offset < match.fill_into_edit.length()) { |
| 260 match.inline_autocompletion = | 260 match.inline_autocompletion = |
| 261 match.fill_into_edit.substr(inline_autocomplete_offset); | 261 match.fill_into_edit.substr(inline_autocomplete_offset); |
| 262 } | 262 } |
| 263 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || | 263 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || |
| 264 !PreventInlineAutocomplete(autocomplete_input_); | 264 !PreventInlineAutocomplete(autocomplete_input_); |
| 265 } | 265 } |
| 266 match.EnsureUWYTIsAllowedToBeDefault(autocomplete_input_.canonicalized_url(), | 266 match.EnsureUWYTIsAllowedToBeDefault( |
| 267 client()->GetTemplateURLService()); | 267 autocomplete_input_, |
| 268 client()->GetAcceptLanguages(), |
| 269 client()->GetTemplateURLService()); |
| 268 | 270 |
| 269 // Format the description autocomplete presentation. | 271 // Format the description autocomplete presentation. |
| 270 match.description = info.title(); | 272 match.description = info.title(); |
| 271 match.description_class = SpansFromTermMatch( | 273 match.description_class = SpansFromTermMatch( |
| 272 history_match.title_matches, match.description.length(), false); | 274 history_match.title_matches, match.description.length(), false); |
| 273 | 275 |
| 274 match.RecordAdditionalInfo("typed count", info.typed_count()); | 276 match.RecordAdditionalInfo("typed count", info.typed_count()); |
| 275 match.RecordAdditionalInfo("visit count", info.visit_count()); | 277 match.RecordAdditionalInfo("visit count", info.visit_count()); |
| 276 match.RecordAdditionalInfo("last visit", info.last_visit()); | 278 match.RecordAdditionalInfo("last visit", info.last_visit()); |
| 277 | 279 |
| 278 return match; | 280 return match; |
| 279 } | 281 } |
| OLD | NEW |