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

Unified Diff: Source/core/html/EmailInputType.cpp

Issue 24201005: Refactoring: Move queryLocalizedString() to Locale class. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/InputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/EmailInputType.cpp
diff --git a/Source/core/html/EmailInputType.cpp b/Source/core/html/EmailInputType.cpp
index af5bc83a57f5a9097719a2af4bc47b63aef94306..ef19641c22859388d58501cc8599e8c027ec49ff 100644
--- a/Source/core/html/EmailInputType.cpp
+++ b/Source/core/html/EmailInputType.cpp
@@ -29,7 +29,7 @@
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
-#include "core/platform/LocalizedStrings.h"
+#include "core/platform/text/PlatformLocale.h"
#include "core/platform/text/RegularExpression.h"
#include "public/platform/Platform.h"
#include "wtf/PassOwnPtr.h"
@@ -183,38 +183,38 @@ String EmailInputType::typeMismatchText() const
String invalidAddress = findInvalidAddress(element()->value());
ASSERT(!invalidAddress.isNull());
if (invalidAddress.isEmpty())
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmailEmpty);
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailEmpty);
String atSign = String("@");
size_t atIndex = invalidAddress.find('@');
if (atIndex == notFound)
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmailNoAtSign, atSign, invalidAddress);
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailNoAtSign, atSign, invalidAddress);
// We check validity against an ASCII value because of difficulty to check
// invalid characters. However we should show Unicode value.
String unicodeAddress = convertEmailAddressToUnicode(invalidAddress);
String localPart = invalidAddress.left(atIndex);
String domain = invalidAddress.substring(atIndex + 1);
if (localPart.isEmpty())
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmailEmptyLocal, atSign, unicodeAddress);
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailEmptyLocal, atSign, unicodeAddress);
if (domain.isEmpty())
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmailEmptyDomain, atSign, unicodeAddress);
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailEmptyDomain, atSign, unicodeAddress);
size_t invalidCharIndex = localPart.find(isInvalidLocalPartCharacter);
if (invalidCharIndex != notFound) {
unsigned charLength = U_IS_LEAD(localPart[invalidCharIndex]) ? 2 : 1;
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidLocal, atSign, localPart.substring(invalidCharIndex, charLength));
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidLocal, atSign, localPart.substring(invalidCharIndex, charLength));
}
invalidCharIndex = domain.find(isInvalidDomainCharacter);
if (invalidCharIndex != notFound) {
unsigned charLength = U_IS_LEAD(domain[invalidCharIndex]) ? 2 : 1;
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidDomain, atSign, domain.substring(invalidCharIndex, charLength));
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidDomain, atSign, domain.substring(invalidCharIndex, charLength));
}
if (!checkValidDotUsage(domain)) {
size_t atIndexInUnicode = unicodeAddress.find('@');
ASSERT(atIndexInUnicode != notFound);
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidDots, String("."), unicodeAddress.substring(atIndexInUnicode + 1));
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidDots, String("."), unicodeAddress.substring(atIndexInUnicode + 1));
}
if (element()->multiple())
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForMultipleEmail);
- return queryLocalizedString(WebLocalizedString::ValidationTypeMismatchForEmail);
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForMultipleEmail);
+ return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmail);
}
bool EmailInputType::isEmailField() const
« no previous file with comments | « no previous file | Source/core/html/InputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698