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

Unified Diff: webkit/support/test_webkit_client.cc

Issue 4678006: Add form validation message strings.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 | « webkit/support/test_webkit_client.h ('k') | webkit/tools/test_shell/test_shell_webkit_init.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/test_webkit_client.cc
===================================================================
--- webkit/support/test_webkit_client.cc (revision 66920)
+++ webkit/support/test_webkit_client.cc (working copy)
@@ -247,6 +247,58 @@
return webkit_glue::WebKitClientImpl::loadResource(name);
}
+WebKit::WebString TestWebKitClient::queryLocalizedString(
+ WebKit::WebLocalizedString::Name name) {
+ // Returns messages same as WebKit's in DRT.
+ // We use different strings for form validation messages.
+ switch (name) {
+ case WebKit::WebLocalizedString::ValidationValueMissing:
+ case WebKit::WebLocalizedString::ValidationValueMissingForCheckbox:
+ case WebKit::WebLocalizedString::ValidationValueMissingForFile:
+ case WebKit::WebLocalizedString::ValidationValueMissingForMultipleFile:
+ case WebKit::WebLocalizedString::ValidationValueMissingForRadio:
+ case WebKit::WebLocalizedString::ValidationValueMissingForSelect:
+ return ASCIIToUTF16("value missing");
+ case WebKit::WebLocalizedString::ValidationTypeMismatch:
+ case WebKit::WebLocalizedString::ValidationTypeMismatchForEmail:
+ case WebKit::WebLocalizedString::ValidationTypeMismatchForMultipleEmail:
+ case WebKit::WebLocalizedString::ValidationTypeMismatchForURL:
+ return ASCIIToUTF16("type mismatch");
+ case WebKit::WebLocalizedString::ValidationPatternMismatch:
+ return ASCIIToUTF16("pattern mismatch");
+ case WebKit::WebLocalizedString::ValidationTooLong:
+ return ASCIIToUTF16("too long");
+ case WebKit::WebLocalizedString::ValidationRangeUnderflow:
+ return ASCIIToUTF16("range underflow");
+ case WebKit::WebLocalizedString::ValidationRangeOverflow:
+ return ASCIIToUTF16("range overflow");
+ case WebKit::WebLocalizedString::ValidationStepMismatch:
+ return ASCIIToUTF16("step mismatch");
+ default:
+ return WebKitClientImpl::queryLocalizedString(name);
+ }
+}
+
+WebKit::WebString TestWebKitClient::queryLocalizedString(
+ WebKit::WebLocalizedString::Name name, const WebKit::WebString& value) {
+ if (name == WebKit::WebLocalizedString::ValidationRangeUnderflow)
+ return ASCIIToUTF16("range underflow");
+ if (name == WebKit::WebLocalizedString::ValidationRangeOverflow)
+ return ASCIIToUTF16("range overflow");
+ return WebKitClientImpl::queryLocalizedString(name, value);
+}
+
+WebKit::WebString TestWebKitClient::queryLocalizedString(
+ WebKit::WebLocalizedString::Name name,
+ const WebKit::WebString& value1,
+ const WebKit::WebString& value2) {
+ if (name == WebKit::WebLocalizedString::ValidationTooLong)
+ return ASCIIToUTF16("too long");
+ if (name == WebKit::WebLocalizedString::ValidationStepMismatch)
+ return ASCIIToUTF16("step mismatch");
+ return WebKitClientImpl::queryLocalizedString(name, value1, value2);
+}
+
WebKit::WebString TestWebKitClient::defaultLocale() {
return ASCIIToUTF16("en-US");
}
« no previous file with comments | « webkit/support/test_webkit_client.h ('k') | webkit/tools/test_shell/test_shell_webkit_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698