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