diff options
Diffstat (limited to 'Source/WebKit/chromium/src/DateTimeChooserImpl.cpp')
| -rw-r--r-- | Source/WebKit/chromium/src/DateTimeChooserImpl.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp index f44157a76..d966ba9d6 100644 --- a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp +++ b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp @@ -60,7 +60,7 @@ DateTimeChooserImpl::DateTimeChooserImpl(ChromeClientImpl* chromeClient, WebCore , m_client(client) , m_popup(0) , m_parameters(parameters) - , m_locale(WebCore::Locale::createDefault()) + , m_locale(WebCore::Locale::create(parameters.locale)) { ASSERT(m_chromeClient); ASSERT(m_client); @@ -110,12 +110,17 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer) IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect); rootViewRectInScreen.move(-view->scrollX(), -view->scrollY()); String todayLabelString; - if (m_parameters.type == WebCore::InputTypeNames::month()) + String otherDateLabelString; + if (m_parameters.type == WebCore::InputTypeNames::month()) { todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisMonthButtonLabel); - else if (m_parameters.type == WebCore::InputTypeNames::week()) + otherDateLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::OtherMonthLabel); + } else if (m_parameters.type == WebCore::InputTypeNames::week()) { todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisWeekButtonLabel); - else + otherDateLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::OtherWeekLabel); + } else { todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday); + otherDateLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::OtherDateLabel); + } addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer); writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss)); @@ -139,12 +144,11 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer) addProperty("stepBase", stepBaseString, writer); addProperty("required", m_parameters.required, writer); addProperty("currentValue", m_parameters.currentValue, writer); - addProperty("locale", WebCore::defaultLanguage(), writer); + addProperty("locale", m_parameters.locale.string(), writer); addProperty("todayLabel", todayLabelString, writer); addProperty("clearLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarClear), writer); addProperty("weekLabel", Platform::current()->queryLocalizedString(WebLocalizedString::WeekNumberLabel), writer); addProperty("weekStartDay", m_locale->firstDayOfWeek(), writer); - addProperty("monthLabels", m_locale->monthLabels(), writer); addProperty("dayLabels", m_locale->weekDayShortLabels(), writer); addProperty("isCalendarRTL", m_locale->isRTL(), writer); addProperty("isRTL", m_parameters.isAnchorElementRTL, writer); @@ -154,8 +158,8 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer) addProperty("suggestionValues", m_parameters.suggestionValues, writer); addProperty("localizedSuggestionValues", m_parameters.localizedSuggestionValues, writer); addProperty("suggestionLabels", m_parameters.suggestionLabels, writer); - addProperty("showOtherDateEntry", m_parameters.type == WebCore::InputTypeNames::date(), writer); - addProperty("otherDateLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherDateLabel), writer); + addProperty("showOtherDateEntry", WebCore::RenderTheme::defaultTheme()->supportsCalendarPicker(m_parameters.type), writer); + addProperty("otherDateLabel", otherDateLabelString, writer); addProperty("suggestionHighlightColor", WebCore::RenderTheme::defaultTheme()->activeListBoxSelectionBackgroundColor().serialized(), writer); addProperty("suggestionHighlightTextColor", WebCore::RenderTheme::defaultTheme()->activeListBoxSelectionForegroundColor().serialized(), writer); } |
