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 "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 } | 603 } |
604 if (is_dir) { | 604 if (is_dir) { |
605 result.append(",1,"); | 605 result.append(",1,"); |
606 } else { | 606 } else { |
607 result.append(",0,"); | 607 result.append(",0,"); |
608 } | 608 } |
609 | 609 |
610 // Negative size means unknown or not applicable (e.g. directory). | 610 // Negative size means unknown or not applicable (e.g. directory). |
611 base::string16 size_string; | 611 base::string16 size_string; |
612 if (size >= 0) | 612 if (size >= 0) |
613 size_string = FormatBytesUnlocalized(size); | 613 size_string = base::FormatBytesUnlocalized(size); |
614 base::EscapeJSONString(size_string, true, &result); | 614 base::EscapeJSONString(size_string, true, &result); |
615 | 615 |
616 result.append(","); | 616 result.append(","); |
617 | 617 |
618 base::string16 modified_str; | 618 base::string16 modified_str; |
619 // |modified| can be NULL in FTP listings. | 619 // |modified| can be NULL in FTP listings. |
620 if (!modified.is_null()) { | 620 if (!modified.is_null()) { |
621 modified_str = base::TimeFormatShortDateAndTime(modified); | 621 modified_str = base::TimeFormatShortDateAndTime(modified); |
622 } | 622 } |
623 base::EscapeJSONString(modified_str, true, &result); | 623 base::EscapeJSONString(modified_str, true, &result); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 if (offset_for_adjustment) | 828 if (offset_for_adjustment) |
829 offsets.push_back(*offset_for_adjustment); | 829 offsets.push_back(*offset_for_adjustment); |
830 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, | 830 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, |
831 unescape_rules, new_parsed, prefix_end, &offsets); | 831 unescape_rules, new_parsed, prefix_end, &offsets); |
832 if (offset_for_adjustment) | 832 if (offset_for_adjustment) |
833 *offset_for_adjustment = offsets[0]; | 833 *offset_for_adjustment = offsets[0]; |
834 return result; | 834 return result; |
835 } | 835 } |
836 | 836 |
837 } // namespace net | 837 } // namespace net |
OLD | NEW |