Exemplo n.º 1
0
String RenderTheme::fileListNameForWidth(Locale& locale, const FileList* fileList, const Font& font, int width) const
{
    if (width <= 0)
        return String();

    String string;
    if (fileList->isEmpty()) {
        string = locale.queryString(blink::WebLocalizedString::FileButtonNoFileSelectedLabel);
    } else if (fileList->length() == 1) {
        string = fileList->item(0)->name();
    } else {
        // FIXME: Localization of fileList->length().
        return StringTruncator::rightTruncate(locale.queryString(blink::WebLocalizedString::MultipleFileUploadText, String::number(fileList->length())), width, font, StringTruncator::EnableRoundingHacks);
    }

    return StringTruncator::centerTruncate(string, width, font, StringTruncator::EnableRoundingHacks);
}
Exemplo n.º 2
0
void getSupportedKeySizes(Locale& locale, Vector<String>& sizes)
{
    sizes.resize(2);
    sizes[0] = locale.queryString(blink::WebLocalizedString::KeygenMenuHighGradeKeySize);
    sizes[1] = locale.queryString(blink::WebLocalizedString::KeygenMenuMediumGradeKeySize);
}