Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: third_party/WebKit/Source/core/html/forms/EmailInputType.cpp

Issue 1841653003: Drop |languages| from {Format,Elide}Url* and IDNToUnicode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in elide_url.cc Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | third_party/WebKit/public/platform/Platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | third_party/WebKit/public/platform/Platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698