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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // last character typed is a slash. That slash is removed by the | 263 // last character typed is a slash. That slash is removed by the |
264 // FormatURLWithOffsets call above. | 264 // FormatURLWithOffsets call above. |
265 if (inline_autocomplete_offset < match.fill_into_edit.length()) { | 265 if (inline_autocomplete_offset < match.fill_into_edit.length()) { |
266 match.inline_autocompletion = | 266 match.inline_autocompletion = |
267 match.fill_into_edit.substr(inline_autocomplete_offset); | 267 match.fill_into_edit.substr(inline_autocomplete_offset); |
268 } | 268 } |
269 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || | 269 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || |
270 !PreventInlineAutocomplete(autocomplete_input_); | 270 !PreventInlineAutocomplete(autocomplete_input_); |
271 } | 271 } |
272 match.EnsureUWYTIsAllowedToBeDefault( | 272 match.EnsureUWYTIsAllowedToBeDefault( |
273 autocomplete_input_.canonicalized_url(), | 273 autocomplete_input_, |
274 TemplateURLServiceFactory::GetForProfile(profile_)); | 274 TemplateURLServiceFactory::GetForProfile(profile_)); |
275 | 275 |
276 // Format the description autocomplete presentation. | 276 // Format the description autocomplete presentation. |
277 match.description = info.title(); | 277 match.description = info.title(); |
278 match.description_class = SpansFromTermMatch( | 278 match.description_class = SpansFromTermMatch( |
279 history_match.title_matches, match.description.length(), false); | 279 history_match.title_matches, match.description.length(), false); |
280 | 280 |
281 match.RecordAdditionalInfo("typed count", info.typed_count()); | 281 match.RecordAdditionalInfo("typed count", info.typed_count()); |
282 match.RecordAdditionalInfo("visit count", info.visit_count()); | 282 match.RecordAdditionalInfo("visit count", info.visit_count()); |
283 match.RecordAdditionalInfo("last visit", info.last_visit()); | 283 match.RecordAdditionalInfo("last visit", info.last_visit()); |
284 | 284 |
285 return match; | 285 return match; |
286 } | 286 } |
OLD | NEW |