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

Side by Side 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 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 unified diff | Download patch
« no previous file with comments | « Source/platform/DateTimeChooser.h ('k') | Source/web/ExternalDateTimeChooser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 addProperty("locale", m_parameters.locale.string(), writer); 134 addProperty("locale", m_parameters.locale.string(), writer);
135 addProperty("todayLabel", todayLabelString, writer); 135 addProperty("todayLabel", todayLabelString, writer);
136 addProperty("clearLabel", locale().queryString(WebLocalizedString::CalendarC lear), writer); 136 addProperty("clearLabel", locale().queryString(WebLocalizedString::CalendarC lear), writer);
137 addProperty("weekLabel", locale().queryString(WebLocalizedString::WeekNumber Label), writer); 137 addProperty("weekLabel", locale().queryString(WebLocalizedString::WeekNumber Label), writer);
138 addProperty("weekStartDay", m_locale->firstDayOfWeek(), writer); 138 addProperty("weekStartDay", m_locale->firstDayOfWeek(), writer);
139 addProperty("shortMonthLabels", m_locale->shortMonthLabels(), writer); 139 addProperty("shortMonthLabels", m_locale->shortMonthLabels(), writer);
140 addProperty("dayLabels", m_locale->weekDayShortLabels(), writer); 140 addProperty("dayLabels", m_locale->weekDayShortLabels(), writer);
141 addProperty("isLocaleRTL", m_locale->isRTL(), writer); 141 addProperty("isLocaleRTL", m_locale->isRTL(), writer);
142 addProperty("isRTL", m_parameters.isAnchorElementRTL, writer); 142 addProperty("isRTL", m_parameters.isAnchorElementRTL, writer);
143 addProperty("mode", m_parameters.type.string(), writer); 143 addProperty("mode", m_parameters.type.string(), writer);
144 if (m_parameters.suggestionValues.size()) { 144 if (m_parameters.suggestions.size()) {
145 Vector<String> suggestionValues;
146 Vector<String> localizedSuggestionValues;
147 Vector<String> suggestionLabels;
148 for (unsigned i = 0; i < m_parameters.suggestions.size(); i++) {
149 suggestionValues.append(valueToDateTimeString(m_parameters.suggestio ns[i].value, m_parameters.type));
150 localizedSuggestionValues.append(m_parameters.suggestions[i].localiz edValue);
151 suggestionLabels.append(m_parameters.suggestions[i].label);
152 }
153 addProperty("suggestionValues", suggestionValues, writer);
154 addProperty("localizedSuggestionValues", localizedSuggestionValues, writ er);
155 addProperty("suggestionLabels", suggestionLabels, writer);
145 addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectI nRootView.width()), writer); 156 addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectI nRootView.width()), writer);
146 addProperty("suggestionValues", m_parameters.suggestionValues, writer);
147 addProperty("localizedSuggestionValues", m_parameters.localizedSuggestio nValues, writer);
148 addProperty("suggestionLabels", m_parameters.suggestionLabels, writer);
149 addProperty("showOtherDateEntry", WebCore::RenderTheme::theme().supports CalendarPicker(m_parameters.type), writer); 157 addProperty("showOtherDateEntry", WebCore::RenderTheme::theme().supports CalendarPicker(m_parameters.type), writer);
150 addProperty("otherDateLabel", otherDateLabelString, writer); 158 addProperty("otherDateLabel", otherDateLabelString, writer);
151 addProperty("suggestionHighlightColor", WebCore::RenderTheme::theme().ac tiveListBoxSelectionBackgroundColor().serialized(), writer); 159 addProperty("suggestionHighlightColor", WebCore::RenderTheme::theme().ac tiveListBoxSelectionBackgroundColor().serialized(), writer);
152 addProperty("suggestionHighlightTextColor", WebCore::RenderTheme::theme( ).activeListBoxSelectionForegroundColor().serialized(), writer); 160 addProperty("suggestionHighlightTextColor", WebCore::RenderTheme::theme( ).activeListBoxSelectionForegroundColor().serialized(), writer);
153 } 161 }
154 addString("}\n", writer); 162 addString("}\n", writer);
155 163
156 writer.addData(pickerCommonJs, sizeof(pickerCommonJs)); 164 writer.addData(pickerCommonJs, sizeof(pickerCommonJs));
157 writer.addData(suggestionPickerJs, sizeof(suggestionPickerJs)); 165 writer.addData(suggestionPickerJs, sizeof(suggestionPickerJs));
158 writer.addData(calendarPickerJs, sizeof(calendarPickerJs)); 166 writer.addData(calendarPickerJs, sizeof(calendarPickerJs));
(...skipping 26 matching lines...) Expand all
185 void DateTimeChooserImpl::didClosePopup() 193 void DateTimeChooserImpl::didClosePopup()
186 { 194 {
187 ASSERT(m_client); 195 ASSERT(m_client);
188 m_popup = 0; 196 m_popup = 0;
189 m_client->didEndChooser(); 197 m_client->didEndChooser();
190 } 198 }
191 199
192 } // namespace blink 200 } // namespace blink
193 201
194 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI) 202 #endif // ENABLE(INPUT_MULTIPLE_FIELDS_UI)
OLDNEW
« 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