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

Unified Diff: Source/web/DateTimeChooserImpl.cpp

Issue 23623017: Prepare for date/time input datalist support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed Created 7 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 | « Source/platform/DateTimeChooser.h ('k') | Source/web/ExternalDateTimeChooser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/DateTimeChooserImpl.cpp
diff --git a/Source/web/DateTimeChooserImpl.cpp b/Source/web/DateTimeChooserImpl.cpp
index cebdacfde1f7e36c3ef16a96d241f7303f1d5e6d..2ada30bcf9cfe20fce18147f72e9184f2267658f 100644
--- a/Source/web/DateTimeChooserImpl.cpp
+++ b/Source/web/DateTimeChooserImpl.cpp
@@ -141,11 +141,19 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
addProperty("isLocaleRTL", m_locale->isRTL(), writer);
addProperty("isRTL", m_parameters.isAnchorElementRTL, writer);
addProperty("mode", m_parameters.type.string(), writer);
- if (m_parameters.suggestionValues.size()) {
+ if (m_parameters.suggestions.size()) {
+ Vector<String> suggestionValues;
+ Vector<String> localizedSuggestionValues;
+ Vector<String> suggestionLabels;
+ for (unsigned i = 0; i < m_parameters.suggestions.size(); i++) {
+ suggestionValues.append(valueToDateTimeString(m_parameters.suggestions[i].value, m_parameters.type));
+ localizedSuggestionValues.append(m_parameters.suggestions[i].localizedValue);
+ suggestionLabels.append(m_parameters.suggestions[i].label);
+ }
+ addProperty("suggestionValues", suggestionValues, writer);
+ addProperty("localizedSuggestionValues", localizedSuggestionValues, writer);
+ addProperty("suggestionLabels", suggestionLabels, writer);
addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectInRootView.width()), writer);
- addProperty("suggestionValues", m_parameters.suggestionValues, writer);
- addProperty("localizedSuggestionValues", m_parameters.localizedSuggestionValues, writer);
- addProperty("suggestionLabels", m_parameters.suggestionLabels, writer);
addProperty("showOtherDateEntry", WebCore::RenderTheme::theme().supportsCalendarPicker(m_parameters.type), writer);
addProperty("otherDateLabel", otherDateLabelString, writer);
addProperty("suggestionHighlightColor", WebCore::RenderTheme::theme().activeListBoxSelectionBackgroundColor().serialized(), writer);
« no previous file with comments | « Source/platform/DateTimeChooser.h ('k') | Source/web/ExternalDateTimeChooser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698