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/string16.h" | 9 #include "base/string16.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, | 444 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, |
445 const std::string& value) { | 445 const std::string& value) { |
446 DCHECK(property.size()); | 446 DCHECK(property.size()); |
447 DCHECK(value.size()); | 447 DCHECK(value.size()); |
448 additional_info[property] = value; | 448 additional_info[property] = value; |
449 } | 449 } |
450 | 450 |
451 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, | 451 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, |
452 int value) { | 452 int value) { |
453 RecordAdditionalInfo(property, StringPrintf("%d", value)); | 453 RecordAdditionalInfo(property, base::StringPrintf("%d", value)); |
454 } | 454 } |
455 | 455 |
456 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, | 456 void AutocompleteMatch::RecordAdditionalInfo(const std::string& property, |
457 const base::Time& value) { | 457 const base::Time& value) { |
458 RecordAdditionalInfo(property, | 458 RecordAdditionalInfo(property, |
459 UTF16ToUTF8(base::TimeFormatShortDateAndTime(value))); | 459 UTF16ToUTF8(base::TimeFormatShortDateAndTime(value))); |
460 } | 460 } |
461 | 461 |
462 #ifndef NDEBUG | 462 #ifndef NDEBUG |
463 void AutocompleteMatch::Validate() const { | 463 void AutocompleteMatch::Validate() const { |
(...skipping 26 matching lines...) Expand all Loading... |
490 << " is unsorted in relation to last offset of " << last_offset | 490 << " is unsorted in relation to last offset of " << last_offset |
491 << ". Provider: " << provider_name << "."; | 491 << ". Provider: " << provider_name << "."; |
492 DCHECK_LT(i->offset, text.length()) | 492 DCHECK_LT(i->offset, text.length()) |
493 << " Classification of [" << i->offset << "," << text.length() | 493 << " Classification of [" << i->offset << "," << text.length() |
494 << "] is out of bounds for \"" << text << "\". Provider: " | 494 << "] is out of bounds for \"" << text << "\". Provider: " |
495 << provider_name << "."; | 495 << provider_name << "."; |
496 last_offset = i->offset; | 496 last_offset = i->offset; |
497 } | 497 } |
498 } | 498 } |
499 #endif | 499 #endif |
OLD | NEW |