| Index: components/error_page/renderer/net_error_helper_core.cc
|
| diff --git a/components/error_page/renderer/net_error_helper_core.cc b/components/error_page/renderer/net_error_helper_core.cc
|
| index 847ff0d22ddeb258bc2755f9fc17f0e0720e3150..808046948f200e541cd9a156d891ace4d3c255fa 100644
|
| --- a/components/error_page/renderer/net_error_helper_core.cc
|
| +++ b/components/error_page/renderer/net_error_helper_core.cc
|
| @@ -46,6 +46,9 @@ namespace {
|
| // Other correction types uses the |kCorrectionResourceTable| array order.
|
| const int kWebSearchQueryUMAId = 100;
|
|
|
| +// Number of URL correction suggestions to display.
|
| +const int kMaxUrlCorrectionsToDisplay = 1;
|
| +
|
| struct CorrectionTypeToResourceTable {
|
| int resource_id;
|
| const char* correction_type;
|
| @@ -330,8 +333,12 @@ scoped_ptr<ErrorPageParams> CreateErrorPageParams(
|
|
|
| // Allow reload page and web search query to be empty strings, but not
|
| // links.
|
| - if ((*it)->url_correction.empty())
|
| + if ((*it)->url_correction.empty() ||
|
| + (params->override_suggestions->GetSize() >=
|
| + kMaxUrlCorrectionsToDisplay)) {
|
| continue;
|
| + }
|
| +
|
| size_t correction_index;
|
| for (correction_index = 0;
|
| correction_index < arraysize(kCorrectionResourceTable);
|
| @@ -341,7 +348,7 @@ scoped_ptr<ErrorPageParams> CreateErrorPageParams(
|
| continue;
|
| }
|
| base::DictionaryValue* suggest = new base::DictionaryValue();
|
| - suggest->SetString("header",
|
| + suggest->SetString("summary",
|
| l10n_util::GetStringUTF16(
|
| kCorrectionResourceTable[correction_index].resource_id));
|
| suggest->SetString("urlCorrection", (*it)->url_correction);
|
|
|