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

Unified Diff: webkit/glue/webkitclient_impl.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/glue/webkitclient_impl.h ('k') | webkit/support/test_webkit_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkitclient_impl.cc
===================================================================
--- webkit/glue/webkitclient_impl.cc (revision 66920)
+++ webkit/glue/webkitclient_impl.cc (working copy)
@@ -156,10 +156,36 @@
return IDS_KEYGEN_HIGH_GRADE_KEY;
case WebLocalizedString::KeygenMenuMediumGradeKeySize:
return IDS_KEYGEN_MED_GRADE_KEY;
- // TODO(tkent): Remove default: when we merge the next
- // WebLocalizedString.h change.
- default:
- break;
+ case WebLocalizedString::ValidationValueMissing:
+ return IDS_FORM_VALIDATION_VALUE_MISSING;
+ case WebLocalizedString::ValidationValueMissingForCheckbox:
+ return IDS_FORM_VALIDATION_VALUE_MISSING_CHECKBOX;
+ case WebLocalizedString::ValidationValueMissingForFile:
+ return IDS_FORM_VALIDATION_VALUE_MISSING_FILE;
+ case WebLocalizedString::ValidationValueMissingForMultipleFile:
+ return IDS_FORM_VALIDATION_VALUE_MISSING_MULTIPLE_FILE;
+ case WebLocalizedString::ValidationValueMissingForRadio:
+ return IDS_FORM_VALIDATION_VALUE_MISSING_RADIO;
+ case WebLocalizedString::ValidationValueMissingForSelect:
+ return IDS_FORM_VALIDATION_VALUE_MISSING_SELECT;
+ case WebLocalizedString::ValidationTypeMismatch:
+ return IDS_FORM_VALIDATION_TYPE_MISMATCH;
+ case WebLocalizedString::ValidationTypeMismatchForEmail:
+ return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL;
+ case WebLocalizedString::ValidationTypeMismatchForMultipleEmail:
+ return IDS_FORM_VALIDATION_TYPE_MISMATCH_MULTIPLE_EMAIL;
+ case WebLocalizedString::ValidationTypeMismatchForURL:
+ return IDS_FORM_VALIDATION_TYPE_MISMATCH_URL;
+ case WebLocalizedString::ValidationPatternMismatch:
+ return IDS_FORM_VALIDATION_PATTERN_MISMATCH;
+ case WebLocalizedString::ValidationTooLong:
+ return IDS_FORM_VALIDATION_TOO_LONG;
+ case WebLocalizedString::ValidationRangeUnderflow:
+ return IDS_FORM_VALIDATION_RANGE_UNDERFLOW;
+ case WebLocalizedString::ValidationRangeOverflow:
+ return IDS_FORM_VALIDATION_RANGE_OVERFLOW;
+ case WebLocalizedString::ValidationStepMismatch:
+ return IDS_FORM_VALIDATION_STEP_MISMATCH;
}
return -1;
}
@@ -311,14 +337,32 @@
WebString WebKitClientImpl::queryLocalizedString(
WebLocalizedString::Name name, int numeric_value) {
+ return queryLocalizedString(name, base::IntToString16(numeric_value));
+}
+
+WebString WebKitClientImpl::queryLocalizedString(
+ WebLocalizedString::Name name, const WebString& value) {
int message_id = ToMessageID(name);
if (message_id < 0)
return WebString();
- return ReplaceStringPlaceholders(GetLocalizedString(message_id),
- base::IntToString16(numeric_value),
- NULL);
+ return ReplaceStringPlaceholders(GetLocalizedString(message_id), value, NULL);
}
+WebString WebKitClientImpl::queryLocalizedString(
+ WebLocalizedString::Name name,
+ const WebString& value1,
+ const WebString& value2) {
+ int message_id = ToMessageID(name);
+ if (message_id < 0)
+ return WebString();
+ std::vector<string16> values;
+ values.reserve(2);
+ values.push_back(value1);
+ values.push_back(value2);
+ return ReplaceStringPlaceholders(
+ GetLocalizedString(message_id), values, NULL);
+}
+
double WebKitClientImpl::currentTime() {
return base::Time::Now().ToDoubleT();
}
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | webkit/support/test_webkit_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698