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

Unified Diff: Source/core/html/InputType.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 | « Source/core/html/InputType.h ('k') | Source/core/platform/LocalizedStrings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/InputType.cpp
diff --git a/Source/core/html/InputType.cpp b/Source/core/html/InputType.cpp
index 4aedcc1d566ba944e21a8658abf5a13293d648bd..b408ac4d499ace6c8b96ba56d4c92d7613c852d1 100644
--- a/Source/core/html/InputType.cpp
+++ b/Source/core/html/InputType.cpp
@@ -65,6 +65,7 @@
#include "core/html/shadow/HTMLShadowElement.h"
#include "core/page/Page.h"
#include "core/platform/LocalizedStrings.h"
+#include "core/platform/text/PlatformLocale.h"
#include "core/platform/text/TextBreakIterator.h"
#include "core/rendering/RenderTheme.h"
@@ -395,11 +396,11 @@ String InputType::validationMessage() const
String localizedCandidate1 = localizeValue(serialize(candidate1));
Decimal candidate2 = candidate1 < numericValue ? candidate1 + stepRange.step() : candidate1 - stepRange.step();
if (!candidate2.isFinite() || candidate2 < stepRange.minimum() || candidate2 > stepRange.maximum())
- return queryLocalizedString(WebLocalizedString::ValidationStepMismatchCloseToLimit, localizedCandidate1);
+ return locale().queryString(WebLocalizedString::ValidationStepMismatchCloseToLimit, localizedCandidate1);
String localizedCandidate2 = localizeValue(serialize(candidate2));
if (candidate1 < candidate2)
- return queryLocalizedString(WebLocalizedString::ValidationStepMismatch, localizedCandidate1, localizedCandidate2);
- return queryLocalizedString(WebLocalizedString::ValidationStepMismatch, localizedCandidate2, localizedCandidate1);
+ return locale().queryString(WebLocalizedString::ValidationStepMismatch, localizedCandidate1, localizedCandidate2);
+ return locale().queryString(WebLocalizedString::ValidationStepMismatch, localizedCandidate2, localizedCandidate1);
}
return emptyString();
@@ -469,6 +470,11 @@ Chrome* InputType::chrome() const
return 0;
}
+Locale& InputType::locale() const
+{
+ return element()->locale();
+}
+
bool InputType::canSetStringValue() const
{
return true;
« no previous file with comments | « Source/core/html/InputType.h ('k') | Source/core/platform/LocalizedStrings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698