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

Unified Diff: components/security_interstitials/core/safe_browsing_loud_error_ui.cc

Issue 2890703002: SafeBrowsing: allow WebView to customize the Help Center URL (Closed)
Patch Set: Created 3 years, 7 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/security_interstitials/core/safe_browsing_loud_error_ui.cc
diff --git a/components/security_interstitials/core/safe_browsing_loud_error_ui.cc b/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
index 8c0df9ab2f270fbb33326a865658ddcaf4c74b43..9aeeb8a24227a41901dc4f7d5b2ca2d45c92f1d0 100644
--- a/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
+++ b/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
@@ -13,14 +13,17 @@
#include "components/security_interstitials/core/metrics_helper.h"
#include "components/strings/grit/components_strings.h"
#include "net/base/escape.h"
+#include "net/base/url_util.h"
#include "ui/base/l10n/l10n_util.h"
namespace security_interstitials {
namespace {
-// URL for the Help Center article on Safe Browsing warnings.
-const char kLearnMore[] =
- "https://support.google.com/chrome/?p=cpn_safe_browsing";
+// URL for the Help Center
+const char kLearnMore[] = "https://support.google.com/chrome/";
+
+// p= URL query parameter for the Safe Browsing article
+const char kDefaultPlink[] = "cpn_safe_browsing";
// For malware interstitial pages, we link the problematic URL to Google's
// diagnostic page.
@@ -165,6 +168,9 @@ void SafeBrowsingLoudErrorUI::HandleCommand(
controller()->metrics_helper()->RecordUserInteraction(
security_interstitials::MetricsHelper::SHOW_LEARN_MORE);
GURL learn_more_url(kLearnMore);
+ learn_more_url = net::AppendQueryParameter(
+ learn_more_url, "p",
+ get_plink() == nullptr ? kDefaultPlink : get_plink());
learn_more_url =
google_util::AppendGoogleLocaleParam(learn_more_url, app_locale());
controller()->OpenUrlInCurrentTab(learn_more_url);

Powered by Google App Engine
This is Rietveld 408576698