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/autocomplete_match.h" | 5 #include "chrome/browser/autocomplete/autocomplete_match.h" |
6 | 6 |
7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 } | 432 } |
433 | 433 |
434 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, | 434 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, |
435 int value) { | 435 int value) { |
436 RecordAdditionalInfo(property, base::IntToString(value)); | 436 RecordAdditionalInfo(property, base::IntToString(value)); |
437 } | 437 } |
438 | 438 |
439 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, | 439 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, |
440 const base::Time& value) { | 440 const base::Time& value) { |
441 RecordAdditionalInfo(property, | 441 RecordAdditionalInfo(property, |
442 UTF16ToUTF8(base::TimeFormatShortDateAndTime(value))); | 442 base::UTF16ToUTF8( |
| 443 base::TimeFormatShortDateAndTime(value))); |
443 } | 444 } |
444 | 445 |
445 std::string AutocompleteMatch::GetAdditionalInfo( | 446 std::string AutocompleteMatch::GetAdditionalInfo( |
446 const std::string& property) const { | 447 const std::string& property) const { |
447 AdditionalInfo::const_iterator i(additional_info.find(property)); | 448 AdditionalInfo::const_iterator i(additional_info.find(property)); |
448 return (i == additional_info.end()) ? std::string() : i->second; | 449 return (i == additional_info.end()) ? std::string() : i->second; |
449 } | 450 } |
450 | 451 |
451 bool AutocompleteMatch::IsVerbatimType() const { | 452 bool AutocompleteMatch::IsVerbatimType() const { |
452 const bool is_keyword_verbatim_match = | 453 const bool is_keyword_verbatim_match = |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 << " is unsorted in relation to last offset of " << last_offset | 490 << " is unsorted in relation to last offset of " << last_offset |
490 << ". Provider: " << provider_name << "."; | 491 << ". Provider: " << provider_name << "."; |
491 DCHECK_LT(i->offset, text.length()) | 492 DCHECK_LT(i->offset, text.length()) |
492 << " Classification of [" << i->offset << "," << text.length() | 493 << " Classification of [" << i->offset << "," << text.length() |
493 << "] is out of bounds for \"" << text << "\". Provider: " | 494 << "] is out of bounds for \"" << text << "\". Provider: " |
494 << provider_name << "."; | 495 << provider_name << "."; |
495 last_offset = i->offset; | 496 last_offset = i->offset; |
496 } | 497 } |
497 } | 498 } |
498 #endif | 499 #endif |
OLD | NEW |