| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // by the FormatURLWithOffsets call above. | 238 // by the FormatURLWithOffsets call above. |
| 239 if (match.inline_autocomplete_offset > match.fill_into_edit.length()) | 239 if (match.inline_autocomplete_offset > match.fill_into_edit.length()) |
| 240 match.inline_autocomplete_offset = match.fill_into_edit.length(); | 240 match.inline_autocomplete_offset = match.fill_into_edit.length(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 // Format the description autocomplete presentation. | 243 // Format the description autocomplete presentation. |
| 244 match.description = info.title(); | 244 match.description = info.title(); |
| 245 match.description_class = SpansFromTermMatch( | 245 match.description_class = SpansFromTermMatch( |
| 246 history_match.title_matches, match.description.length(), false); | 246 history_match.title_matches, match.description.length(), false); |
| 247 | 247 |
| 248 match.RecordAdditionalInfo("typed count", info.typed_count()); |
| 249 match.RecordAdditionalInfo("visit count", info.visit_count()); |
| 250 match.RecordAdditionalInfo("last visit", info.last_visit()); |
| 251 |
| 248 return match; | 252 return match; |
| 249 } | 253 } |
| 250 | 254 |
| 251 history::InMemoryURLIndex* HistoryQuickProvider::GetIndex() { | 255 history::InMemoryURLIndex* HistoryQuickProvider::GetIndex() { |
| 252 if (index_for_testing_.get()) | 256 if (index_for_testing_.get()) |
| 253 return index_for_testing_.get(); | 257 return index_for_testing_.get(); |
| 254 | 258 |
| 255 HistoryService* const history_service = | 259 HistoryService* const history_service = |
| 256 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 260 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
| 257 if (!history_service) | 261 if (!history_service) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 284 do { | 288 do { |
| 285 offset += matches[i].length; | 289 offset += matches[i].length; |
| 286 ++i; | 290 ++i; |
| 287 } while ((i < match_count) && (offset == matches[i].offset)); | 291 } while ((i < match_count) && (offset == matches[i].offset)); |
| 288 if (offset < text_length) | 292 if (offset < text_length) |
| 289 spans.push_back(ACMatchClassification(offset, url_style)); | 293 spans.push_back(ACMatchClassification(offset, url_style)); |
| 290 } | 294 } |
| 291 | 295 |
| 292 return spans; | 296 return spans; |
| 293 } | 297 } |
| OLD | NEW |