OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the WebKit project. | 2 * This file is part of the WebKit project. |
3 * | 3 * |
4 * Copyright (C) 2009 Michelangelo De Simone <micdesim@gmail.com> | 4 * Copyright (C) 2009 Michelangelo De Simone <micdesim@gmail.com> |
5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 if (!address.containsOnlyASCII()) | 90 if (!address.containsOnlyASCII()) |
91 return address; | 91 return address; |
92 | 92 |
93 size_t atPosition = address.find('@'); | 93 size_t atPosition = address.find('@'); |
94 if (atPosition == kNotFound) | 94 if (atPosition == kNotFound) |
95 return address; | 95 return address; |
96 | 96 |
97 if (address.find("xn--", atPosition + 1) == kNotFound) | 97 if (address.find("xn--", atPosition + 1) == kNotFound) |
98 return address; | 98 return address; |
99 | 99 |
100 if (!chromeClient()) | 100 String unicodeHost = Platform::current()->convertIDNToUnicode(address.substr
ing(atPosition + 1)); |
101 return address; | |
102 | |
103 String languages = chromeClient()->acceptLanguages(); | |
104 String unicodeHost = Platform::current()->convertIDNToUnicode(address.substr
ing(atPosition + 1), languages); | |
105 StringBuilder builder; | 101 StringBuilder builder; |
106 builder.append(address, 0, atPosition + 1); | 102 builder.append(address, 0, atPosition + 1); |
107 builder.append(unicodeHost); | 103 builder.append(unicodeHost); |
108 return builder.toString(); | 104 return builder.toString(); |
109 } | 105 } |
110 | 106 |
111 static bool isInvalidLocalPartCharacter(UChar ch) | 107 static bool isInvalidLocalPartCharacter(UChar ch) |
112 { | 108 { |
113 if (!isASCII(ch)) | 109 if (!isASCII(ch)) |
114 return true; | 110 return true; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 builder.reserveCapacity(value.length()); | 293 builder.reserveCapacity(value.length()); |
298 for (size_t i = 0; i < addresses.size(); ++i) { | 294 for (size_t i = 0; i < addresses.size(); ++i) { |
299 if (i > 0) | 295 if (i > 0) |
300 builder.append(','); | 296 builder.append(','); |
301 builder.append(convertEmailAddressToUnicode(addresses[i])); | 297 builder.append(convertEmailAddressToUnicode(addresses[i])); |
302 } | 298 } |
303 return builder.toString(); | 299 return builder.toString(); |
304 } | 300 } |
305 | 301 |
306 } // namespace blink | 302 } // namespace blink |
OLD | NEW |