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()->GetTemplateURLService()); |
268 | 269 |
269 // Format the description autocomplete presentation. | 270 // Format the description autocomplete presentation. |
270 match.description = info.title(); | 271 match.description = info.title(); |
271 match.description_class = SpansFromTermMatch( | 272 match.description_class = SpansFromTermMatch( |
272 history_match.title_matches, match.description.length(), false); | 273 history_match.title_matches, match.description.length(), false); |
273 | 274 |
274 match.RecordAdditionalInfo("typed count", info.typed_count()); | 275 match.RecordAdditionalInfo("typed count", info.typed_count()); |
275 match.RecordAdditionalInfo("visit count", info.visit_count()); | 276 match.RecordAdditionalInfo("visit count", info.visit_count()); |
276 match.RecordAdditionalInfo("last visit", info.last_visit()); | 277 match.RecordAdditionalInfo("last visit", info.last_visit()); |
277 | 278 |
278 return match; | 279 return match; |
279 } | 280 } |
OLD | NEW |