OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |