Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: components/error_page/renderer/net_error_helper_core.cc

Issue 1639953002: Network error interstitial update - add suggestions list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8fc1f3cede6e2684da7e7ba031d02b317fa21a46 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 kUrlCorrectionsToDisplay = 1;
mmenke 2016/02/18 19:51:19 +kMaxUrl...?
edwardjung 2016/02/19 18:18:22 Done.
+
struct CorrectionTypeToResourceTable {
int resource_id;
const char* correction_type;
@@ -336,12 +339,15 @@ scoped_ptr<ErrorPageParams> CreateErrorPageParams(
for (correction_index = 0;
correction_index < arraysize(kCorrectionResourceTable);
++correction_index) {
+ if (params->override_suggestions->GetSize() == kUrlCorrectionsToDisplay) {
mmenke 2016/02/18 19:51:19 Think this should be >=, for clarity. Also, this
edwardjung 2016/02/19 18:18:22 Thanks for spotting this. I actually needed to u
+ break;
+ }
mmenke 2016/02/18 19:51:19 Remove braces
edwardjung 2016/02/19 18:18:22 Done.
if ((*it)->correction_type !=
kCorrectionResourceTable[correction_index].correction_type) {
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);

Powered by Google App Engine
This is Rietveld 408576698