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 "chrome/browser/autocomplete/history_quick_provider.h" | 5 #include "chrome/browser/autocomplete/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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // FormatURLWithOffsets call above. | 267 // FormatURLWithOffsets call above. |
268 if (inline_autocomplete_offset < match.fill_into_edit.length()) { | 268 if (inline_autocomplete_offset < match.fill_into_edit.length()) { |
269 match.inline_autocompletion = | 269 match.inline_autocompletion = |
270 match.fill_into_edit.substr(inline_autocomplete_offset); | 270 match.fill_into_edit.substr(inline_autocomplete_offset); |
271 } | 271 } |
272 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || | 272 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || |
273 !PreventInlineAutocomplete(autocomplete_input_); | 273 !PreventInlineAutocomplete(autocomplete_input_); |
274 } | 274 } |
275 match.EnsureUWYTIsAllowedToBeDefault( | 275 match.EnsureUWYTIsAllowedToBeDefault( |
276 autocomplete_input_.canonicalized_url(), | 276 autocomplete_input_.canonicalized_url(), |
| 277 autocomplete_input_.parts().scheme.is_nonempty(), |
277 TemplateURLServiceFactory::GetForProfile(profile_)); | 278 TemplateURLServiceFactory::GetForProfile(profile_)); |
278 | 279 |
279 // Format the description autocomplete presentation. | 280 // Format the description autocomplete presentation. |
280 match.description = info.title(); | 281 match.description = info.title(); |
281 match.description_class = SpansFromTermMatch( | 282 match.description_class = SpansFromTermMatch( |
282 history_match.title_matches, match.description.length(), false); | 283 history_match.title_matches, match.description.length(), false); |
283 | 284 |
284 match.RecordAdditionalInfo("typed count", info.typed_count()); | 285 match.RecordAdditionalInfo("typed count", info.typed_count()); |
285 match.RecordAdditionalInfo("visit count", info.visit_count()); | 286 match.RecordAdditionalInfo("visit count", info.visit_count()); |
286 match.RecordAdditionalInfo("last visit", info.last_visit()); | 287 match.RecordAdditionalInfo("last visit", info.last_visit()); |
287 | 288 |
288 return match; | 289 return match; |
289 } | 290 } |
OLD | NEW |