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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // |fill_into_edit| if the user has typed an URL with a scheme and the | 258 // |fill_into_edit| if the user has typed an URL with a scheme and the |
259 // last character typed is a slash. That slash is removed by the | 259 // last character typed is a slash. That slash is removed by the |
260 // FormatURLWithOffsets call above. | 260 // FormatURLWithOffsets call above. |
261 if (inline_autocomplete_offset < match.fill_into_edit.length()) { | 261 if (inline_autocomplete_offset < match.fill_into_edit.length()) { |
262 match.inline_autocompletion = | 262 match.inline_autocompletion = |
263 match.fill_into_edit.substr(inline_autocomplete_offset); | 263 match.fill_into_edit.substr(inline_autocomplete_offset); |
264 } | 264 } |
265 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || | 265 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || |
266 !PreventInlineAutocomplete(autocomplete_input_); | 266 !PreventInlineAutocomplete(autocomplete_input_); |
267 } | 267 } |
268 match.EnsureUWYTIsAllowedToBeDefault(autocomplete_input_.canonicalized_url(), | 268 match.EnsureUWYTIsAllowedToBeDefault( |
269 client()->GetTemplateURLService()); | 269 autocomplete_input_, |
| 270 client()->GetTemplateURLService()); |
270 | 271 |
271 // Format the description autocomplete presentation. | 272 // Format the description autocomplete presentation. |
272 match.description = info.title(); | 273 match.description = info.title(); |
273 match.description_class = SpansFromTermMatch( | 274 match.description_class = SpansFromTermMatch( |
274 history_match.title_matches, match.description.length(), false); | 275 history_match.title_matches, match.description.length(), false); |
275 | 276 |
276 match.RecordAdditionalInfo("typed count", info.typed_count()); | 277 match.RecordAdditionalInfo("typed count", info.typed_count()); |
277 match.RecordAdditionalInfo("visit count", info.visit_count()); | 278 match.RecordAdditionalInfo("visit count", info.visit_count()); |
278 match.RecordAdditionalInfo("last visit", info.last_visit()); | 279 match.RecordAdditionalInfo("last visit", info.last_visit()); |
279 | 280 |
280 return match; | 281 return match; |
281 } | 282 } |
OLD | NEW |