| 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 kFormatUrlOmitHTTP | kFormatUrlOmitTrailingSlashOnBareHostname; | 580 kFormatUrlOmitHTTP | kFormatUrlOmitTrailingSlashOnBareHostname; |
| 581 | 581 |
| 582 base::string16 IDNToUnicode(const std::string& host, | 582 base::string16 IDNToUnicode(const std::string& host, |
| 583 const std::string& languages) { | 583 const std::string& languages) { |
| 584 return IDNToUnicodeWithAdjustments(host, languages, NULL); | 584 return IDNToUnicodeWithAdjustments(host, languages, NULL); |
| 585 } | 585 } |
| 586 | 586 |
| 587 std::string GetDirectoryListingEntry(const base::string16& name, | 587 std::string GetDirectoryListingEntry(const base::string16& name, |
| 588 const std::string& raw_bytes, | 588 const std::string& raw_bytes, |
| 589 bool is_dir, | 589 bool is_dir, |
| 590 int64 size, | 590 int64_t size, |
| 591 Time modified) { | 591 Time modified) { |
| 592 std::string result; | 592 std::string result; |
| 593 result.append("<script>addRow("); | 593 result.append("<script>addRow("); |
| 594 base::EscapeJSONString(name, true, &result); | 594 base::EscapeJSONString(name, true, &result); |
| 595 result.append(","); | 595 result.append(","); |
| 596 if (raw_bytes.empty()) { | 596 if (raw_bytes.empty()) { |
| 597 base::EscapeJSONString(EscapePath(base::UTF16ToUTF8(name)), true, &result); | 597 base::EscapeJSONString(EscapePath(base::UTF16ToUTF8(name)), true, &result); |
| 598 } else { | 598 } else { |
| 599 base::EscapeJSONString(EscapePath(raw_bytes), true, &result); | 599 base::EscapeJSONString(EscapePath(raw_bytes), true, &result); |
| 600 } | 600 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 if (offset_for_adjustment) | 823 if (offset_for_adjustment) |
| 824 offsets.push_back(*offset_for_adjustment); | 824 offsets.push_back(*offset_for_adjustment); |
| 825 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, | 825 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, |
| 826 unescape_rules, new_parsed, prefix_end, &offsets); | 826 unescape_rules, new_parsed, prefix_end, &offsets); |
| 827 if (offset_for_adjustment) | 827 if (offset_for_adjustment) |
| 828 *offset_for_adjustment = offsets[0]; | 828 *offset_for_adjustment = offsets[0]; |
| 829 return result; | 829 return result; |
| 830 } | 830 } |
| 831 | 831 |
| 832 } // namespace net | 832 } // namespace net |
| OLD | NEW |