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

Unified Diff: components/security_interstitials/content/security_interstitial_controller_client.cc

Issue 2955503002: Make interstitial links open in a new tab (Closed)
Patch Set: Rebase CL Created 3 years, 6 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/content/security_interstitial_controller_client.cc
diff --git a/components/security_interstitials/content/security_interstitial_controller_client.cc b/components/security_interstitials/content/security_interstitial_controller_client.cc
index 87d0789a3912da7f940726d322303a7f59526e8d..5fd6d0e84afe5b63a4546e69a655729cc72f2b3f 100644
--- a/components/security_interstitials/content/security_interstitial_controller_client.cc
+++ b/components/security_interstitials/content/security_interstitial_controller_client.cc
@@ -17,6 +17,9 @@ using content::Referrer;
namespace security_interstitials {
+// Help Center url
meacer 2017/06/23 20:28:32 nit: End comments with a period.
sperigo 2017/06/23 21:32:11 Done.
+const char kHelpCenterUrl[] = "https://support.google.com/chrome/";
+
SecurityInterstitialControllerClient::SecurityInterstitialControllerClient(
content::WebContents* web_contents,
std::unique_ptr<MetricsHelper> metrics_helper,
@@ -28,7 +31,9 @@ SecurityInterstitialControllerClient::SecurityInterstitialControllerClient(
interstitial_page_(nullptr),
prefs_(prefs),
app_locale_(app_locale),
- default_safe_page_(default_safe_page) {}
+ default_safe_page_(default_safe_page) {
+ help_center_url_ = GURL(kHelpCenterUrl);
meacer 2017/06/23 20:28:32 You can move this to the parameter list: ... defa
sperigo 2017/06/23 21:32:11 Done.
+}
SecurityInterstitialControllerClient::~SecurityInterstitialControllerClient() {}
@@ -71,6 +76,14 @@ void SecurityInterstitialControllerClient::Reload() {
web_contents_->GetController().Reload(content::ReloadType::NORMAL, true);
}
+void SecurityInterstitialControllerClient::OpenUrlInNewForegroundTab(
+ const GURL& url) {
+ content::OpenURLParams params(url, Referrer(),
+ WindowOpenDisposition::NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_LINK, false);
+ web_contents_->OpenURL(params);
+}
+
void SecurityInterstitialControllerClient::OpenUrlInCurrentTab(
const GURL& url) {
content::OpenURLParams params(url, Referrer(),
@@ -103,4 +116,13 @@ void SecurityInterstitialControllerClient::LaunchDateAndTimeSettings() {
NOTREACHED();
}
+GURL SecurityInterstitialControllerClient::GetHelpCenterUrl() const {
+ return help_center_url_;
+}
+
+void SecurityInterstitialControllerClient::SetHelpCenterUrlForTesting(
+ const GURL test_url) {
meacer 2017/06/23 20:28:32 const GURL& test_url
sperigo 2017/06/23 21:32:11 Done.
+ help_center_url_ = test_url;
+}
+
} // namespace security_interstitials

Powered by Google App Engine
This is Rietveld 408576698