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

Side by Side Diff: components/security_interstitials/core/ssl_error_ui.cc

Issue 2955503002: Make interstitial links open in a new tab (Closed)
Patch Set: Fix compilation error Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/security_interstitials/core/ssl_error_ui.h" 5 #include "components/security_interstitials/core/ssl_error_ui.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "components/security_interstitials/core/common_string_util.h" 8 #include "components/security_interstitials/core/common_string_util.h"
9 #include "components/security_interstitials/core/metrics_helper.h" 9 #include "components/security_interstitials/core/metrics_helper.h"
10 #include "components/ssl_errors/error_classification.h" 10 #include "components/ssl_errors/error_classification.h"
11 #include "components/ssl_errors/error_info.h" 11 #include "components/ssl_errors/error_info.h"
12 #include "components/strings/grit/components_strings.h" 12 #include "components/strings/grit/components_strings.h"
13 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
14 14
15 namespace security_interstitials { 15 namespace security_interstitials {
16 namespace { 16 namespace {
17 17
18 // URL for help page. 18 // Path to the relevant help center page.
19 const char kHelpURL[] = "https://support.google.com/chrome/answer/6098869"; 19 const char kHelpPath[] = "answer/6098869";
20 20
21 bool IsMasked(int options, SSLErrorUI::SSLErrorOptionsMask mask) { 21 bool IsMasked(int options, SSLErrorUI::SSLErrorOptionsMask mask) {
22 return ((options & mask) != 0); 22 return ((options & mask) != 0);
23 } 23 }
24 24
25 } // namespace 25 } // namespace
26 26
27 SSLErrorUI::SSLErrorUI(const GURL& request_url, 27 SSLErrorUI::SSLErrorUI(const GURL& request_url,
28 int cert_error, 28 int cert_error,
29 const net::SSLInfo& ssl_info, 29 const net::SSLInfo& ssl_info,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 case CMD_DONT_REPORT: 183 case CMD_DONT_REPORT:
184 controller_->SetReportingPreference(false); 184 controller_->SetReportingPreference(false);
185 break; 185 break;
186 case CMD_SHOW_MORE_SECTION: 186 case CMD_SHOW_MORE_SECTION:
187 controller_->metrics_helper()->RecordUserInteraction( 187 controller_->metrics_helper()->RecordUserInteraction(
188 security_interstitials::MetricsHelper::SHOW_ADVANCED); 188 security_interstitials::MetricsHelper::SHOW_ADVANCED);
189 break; 189 break;
190 case CMD_OPEN_HELP_CENTER: 190 case CMD_OPEN_HELP_CENTER:
191 controller_->metrics_helper()->RecordUserInteraction( 191 controller_->metrics_helper()->RecordUserInteraction(
192 security_interstitials::MetricsHelper::SHOW_LEARN_MORE); 192 security_interstitials::MetricsHelper::SHOW_LEARN_MORE);
193 controller_->OpenUrlInCurrentTab(GURL(kHelpURL)); 193 controller_->OpenUrlInNewForegroundTab(
194 controller_->GetBaseHelpCenterUrl().Resolve(kHelpPath));
194 break; 195 break;
195 case CMD_RELOAD: 196 case CMD_RELOAD:
196 controller_->metrics_helper()->RecordUserInteraction( 197 controller_->metrics_helper()->RecordUserInteraction(
197 security_interstitials::MetricsHelper::RELOAD); 198 security_interstitials::MetricsHelper::RELOAD);
198 controller_->Reload(); 199 controller_->Reload();
199 break; 200 break;
200 case CMD_OPEN_REPORTING_PRIVACY: 201 case CMD_OPEN_REPORTING_PRIVACY:
201 controller_->OpenExtendedReportingPrivacyPolicy(); 202 controller_->OpenExtendedReportingPrivacyPolicy();
202 break; 203 break;
203 case CMD_OPEN_WHITEPAPER: 204 case CMD_OPEN_WHITEPAPER:
204 controller_->OpenExtendedReportingWhitepaper(); 205 controller_->OpenExtendedReportingWhitepaper();
205 break; 206 break;
206 case CMD_OPEN_DATE_SETTINGS: 207 case CMD_OPEN_DATE_SETTINGS:
207 case CMD_OPEN_DIAGNOSTIC: 208 case CMD_OPEN_DIAGNOSTIC:
208 case CMD_OPEN_LOGIN: 209 case CMD_OPEN_LOGIN:
209 case CMD_REPORT_PHISHING_ERROR: 210 case CMD_REPORT_PHISHING_ERROR:
210 // Not supported by the SSL error page. 211 // Not supported by the SSL error page.
211 NOTREACHED() << "Unsupported command: " << command; 212 NOTREACHED() << "Unsupported command: " << command;
212 case CMD_ERROR: 213 case CMD_ERROR:
213 case CMD_TEXT_FOUND: 214 case CMD_TEXT_FOUND:
214 case CMD_TEXT_NOT_FOUND: 215 case CMD_TEXT_NOT_FOUND:
215 // Commands are for testing. 216 // Commands are for testing.
216 break; 217 break;
217 } 218 }
218 } 219 }
219 220
220 } // security_interstitials 221 } // security_interstitials
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698