| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Implementation of the SafeBrowsingBlockingPage class. | 5 // Implementation of the SafeBrowsingBlockingPage class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 SetReportingPreference(false); | 244 SetReportingPreference(false); |
| 245 break; | 245 break; |
| 246 } | 246 } |
| 247 case security_interstitials::CMD_OPEN_HELP_CENTER: { | 247 case security_interstitials::CMD_OPEN_HELP_CENTER: { |
| 248 // User pressed "Learn more". | 248 // User pressed "Learn more". |
| 249 metrics_helper()->RecordUserInteraction( | 249 metrics_helper()->RecordUserInteraction( |
| 250 security_interstitials::MetricsHelper::SHOW_LEARN_MORE); | 250 security_interstitials::MetricsHelper::SHOW_LEARN_MORE); |
| 251 GURL learn_more_url(kLearnMore); | 251 GURL learn_more_url(kLearnMore); |
| 252 learn_more_url = google_util::AppendGoogleLocaleParam( | 252 learn_more_url = google_util::AppendGoogleLocaleParam( |
| 253 learn_more_url, g_browser_process->GetApplicationLocale()); | 253 learn_more_url, g_browser_process->GetApplicationLocale()); |
| 254 OpenURLParams params(learn_more_url, | 254 OpenURLParams params(learn_more_url, Referrer(), |
| 255 Referrer(), | 255 WindowOpenDisposition::CURRENT_TAB, |
| 256 CURRENT_TAB, | 256 ui::PAGE_TRANSITION_LINK, false); |
| 257 ui::PAGE_TRANSITION_LINK, | |
| 258 false); | |
| 259 web_contents()->OpenURL(params); | 257 web_contents()->OpenURL(params); |
| 260 break; | 258 break; |
| 261 } | 259 } |
| 262 case security_interstitials::CMD_OPEN_REPORTING_PRIVACY: { | 260 case security_interstitials::CMD_OPEN_REPORTING_PRIVACY: { |
| 263 // User pressed on the SB Extended Reporting "privacy policy" link. | 261 // User pressed on the SB Extended Reporting "privacy policy" link. |
| 264 OpenExtendedReportingPrivacyPolicy(); | 262 OpenExtendedReportingPrivacyPolicy(); |
| 265 break; | 263 break; |
| 266 } | 264 } |
| 267 case security_interstitials::CMD_PROCEED: { | 265 case security_interstitials::CMD_PROCEED: { |
| 268 // User pressed on the button to proceed. | 266 // User pressed on the button to proceed. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 std::string diagnostic = | 307 std::string diagnostic = |
| 310 base::StringPrintf(kSbDiagnosticUrl, | 308 base::StringPrintf(kSbDiagnosticUrl, |
| 311 net::EscapeQueryParamValue(bad_url_spec, true).c_str()); | 309 net::EscapeQueryParamValue(bad_url_spec, true).c_str()); |
| 312 GURL diagnostic_url(diagnostic); | 310 GURL diagnostic_url(diagnostic); |
| 313 diagnostic_url = google_util::AppendGoogleLocaleParam( | 311 diagnostic_url = google_util::AppendGoogleLocaleParam( |
| 314 diagnostic_url, g_browser_process->GetApplicationLocale()); | 312 diagnostic_url, g_browser_process->GetApplicationLocale()); |
| 315 DCHECK(unsafe_resource.threat_type == SB_THREAT_TYPE_URL_MALWARE || | 313 DCHECK(unsafe_resource.threat_type == SB_THREAT_TYPE_URL_MALWARE || |
| 316 unsafe_resource.threat_type == | 314 unsafe_resource.threat_type == |
| 317 SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL || | 315 SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL || |
| 318 unsafe_resource.threat_type == SB_THREAT_TYPE_URL_UNWANTED); | 316 unsafe_resource.threat_type == SB_THREAT_TYPE_URL_UNWANTED); |
| 319 OpenURLParams params( | 317 OpenURLParams params(diagnostic_url, Referrer(), |
| 320 diagnostic_url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_LINK, | 318 WindowOpenDisposition::CURRENT_TAB, |
| 321 false); | 319 ui::PAGE_TRANSITION_LINK, false); |
| 322 web_contents()->OpenURL(params); | 320 web_contents()->OpenURL(params); |
| 323 break; | 321 break; |
| 324 } | 322 } |
| 325 case security_interstitials::CMD_SHOW_MORE_SECTION: { | 323 case security_interstitials::CMD_SHOW_MORE_SECTION: { |
| 326 // User has opened up the hidden text. | 324 // User has opened up the hidden text. |
| 327 metrics_helper()->RecordUserInteraction( | 325 metrics_helper()->RecordUserInteraction( |
| 328 security_interstitials::MetricsHelper::SHOW_ADVANCED); | 326 security_interstitials::MetricsHelper::SHOW_ADVANCED); |
| 329 break; | 327 break; |
| 330 } | 328 } |
| 331 case security_interstitials::CMD_REPORT_PHISHING_ERROR: { | 329 case security_interstitials::CMD_REPORT_PHISHING_ERROR: { |
| 332 // User wants to report a phishing error. | 330 // User wants to report a phishing error. |
| 333 metrics_helper()->RecordUserInteraction( | 331 metrics_helper()->RecordUserInteraction( |
| 334 security_interstitials::MetricsHelper::REPORT_PHISHING_ERROR); | 332 security_interstitials::MetricsHelper::REPORT_PHISHING_ERROR); |
| 335 GURL phishing_error_url(kReportPhishingErrorUrl); | 333 GURL phishing_error_url(kReportPhishingErrorUrl); |
| 336 phishing_error_url = google_util::AppendGoogleLocaleParam( | 334 phishing_error_url = google_util::AppendGoogleLocaleParam( |
| 337 phishing_error_url, g_browser_process->GetApplicationLocale()); | 335 phishing_error_url, g_browser_process->GetApplicationLocale()); |
| 338 OpenURLParams params(phishing_error_url, Referrer(), CURRENT_TAB, | 336 OpenURLParams params(phishing_error_url, Referrer(), |
| 337 WindowOpenDisposition::CURRENT_TAB, |
| 339 ui::PAGE_TRANSITION_LINK, false); | 338 ui::PAGE_TRANSITION_LINK, false); |
| 340 web_contents()->OpenURL(params); | 339 web_contents()->OpenURL(params); |
| 341 break; | 340 break; |
| 342 } | 341 } |
| 343 } | 342 } |
| 344 } | 343 } |
| 345 | 344 |
| 346 void SafeBrowsingBlockingPage::OverrideRendererPrefs( | 345 void SafeBrowsingBlockingPage::OverrideRendererPrefs( |
| 347 content::RendererPreferences* prefs) { | 346 content::RendererPreferences* prefs) { |
| 348 Profile* profile = Profile::FromBrowserContext( | 347 Profile* profile = Profile::FromBrowserContext( |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 l10n_util::GetStringFUTF16(IDS_PHISHING_V4_EXPLANATION_PARAGRAPH, | 724 l10n_util::GetStringFUTF16(IDS_PHISHING_V4_EXPLANATION_PARAGRAPH, |
| 726 GetFormattedHostName())); | 725 GetFormattedHostName())); |
| 727 load_time_data->SetString( | 726 load_time_data->SetString( |
| 728 "finalParagraph", | 727 "finalParagraph", |
| 729 l10n_util::GetStringUTF16(IDS_PHISHING_V4_PROCEED_AND_REPORT_PARAGRAPH)); | 728 l10n_util::GetStringUTF16(IDS_PHISHING_V4_PROCEED_AND_REPORT_PARAGRAPH)); |
| 730 | 729 |
| 731 PopulateExtendedReportingOption(load_time_data); | 730 PopulateExtendedReportingOption(load_time_data); |
| 732 } | 731 } |
| 733 | 732 |
| 734 } // namespace safe_browsing | 733 } // namespace safe_browsing |
| OLD | NEW |