Commit 54152de9 authored by Anton Ohontsev's avatar Anton Ohontsev Committed by Commit Bot

Fix hung dialog close button label.

At some point we have lost update the label text. When we create
it hung_pages_table_model_->RowCount () == 0 but suppose to be
equal to 1. This happens cause we counting hung pages after setting
label text. So a plural form of text is "Exit pages" instead of
"Exit page". The bug is not so terrible in Eng locale. But for other
languages (ex. Russian) plural form of zero pages invoke eyes bleeding.

Bug: 1132338
Change-Id: I8ba0f2e36404323d862ff6967e6a7127dd80939b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431965
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Auto-Submit: Anton Okhontsev <movax01h@yandex-team.ru>
Cr-Commit-Position: refs/heads/master@{#811204}
parent 6110eaa7
......@@ -288,10 +288,6 @@ HungRendererDialogView::HungRendererDialogView() {
hung_pages_table_model_.get(), columns, views::ICON_AND_TEXT, true);
hung_pages_table_ = hung_pages_table.get();
SetButtonLabel(
ui::DIALOG_BUTTON_CANCEL,
l10n_util::GetPluralStringFUTF16(IDS_BROWSER_HANGMONITOR_RENDERER_END,
hung_pages_table_model_->RowCount()));
SetButtonLabel(
ui::DIALOG_BUTTON_OK,
l10n_util::GetStringUTF16(IDS_BROWSER_HANGMONITOR_RENDERER_WAIT));
......@@ -463,8 +459,10 @@ void HungRendererDialogView::UpdateLabels() {
GetWidget()->UpdateWindowTitle();
info_label_->SetText(l10n_util::GetPluralStringFUTF16(
IDS_BROWSER_HANGMONITOR_RENDERER, hung_pages_table_model_->RowCount()));
// Update the "Exit" button.
DialogModelChanged();
SetButtonLabel(
ui::DIALOG_BUTTON_CANCEL,
l10n_util::GetPluralStringFUTF16(IDS_BROWSER_HANGMONITOR_RENDERER_END,
hung_pages_table_model_->RowCount()));
}
void HungRendererDialogView::CloseDialogWithNoAction() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment