| 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 "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 ->trigger_manager() | 136 ->trigger_manager() |
| 137 ->StartCollectingThreatDetails( | 137 ->StartCollectingThreatDetails( |
| 138 SafeBrowsingTriggerType::SECURITY_INTERSTITIAL, web_contents, | 138 SafeBrowsingTriggerType::SECURITY_INTERSTITIAL, web_contents, |
| 139 unsafe_resources[0], profile->GetRequestContext(), | 139 unsafe_resources[0], profile->GetRequestContext(), |
| 140 HistoryServiceFactory::GetForProfile( | 140 HistoryServiceFactory::GetForProfile( |
| 141 profile, ServiceAccessType::EXPLICIT_ACCESS), | 141 profile, ServiceAccessType::EXPLICIT_ACCESS), |
| 142 sb_error_ui()->get_error_display_options()); | 142 sb_error_ui()->get_error_display_options()); |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool SafeBrowsingBlockingPage::ShouldReportThreatDetails( | |
| 147 SBThreatType threat_type) { | |
| 148 return threat_type == SB_THREAT_TYPE_URL_PHISHING || | |
| 149 threat_type == SB_THREAT_TYPE_URL_MALWARE || | |
| 150 threat_type == SB_THREAT_TYPE_URL_UNWANTED || | |
| 151 threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING || | |
| 152 threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE || | |
| 153 threat_type == SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING; | |
| 154 } | |
| 155 | |
| 156 SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { | 146 SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() { |
| 157 } | 147 } |
| 158 | 148 |
| 159 void SafeBrowsingBlockingPage::OverrideRendererPrefs( | 149 void SafeBrowsingBlockingPage::OverrideRendererPrefs( |
| 160 content::RendererPreferences* prefs) { | 150 content::RendererPreferences* prefs) { |
| 161 Profile* profile = Profile::FromBrowserContext( | 151 Profile* profile = Profile::FromBrowserContext( |
| 162 web_contents()->GetBrowserContext()); | 152 web_contents()->GetBrowserContext()); |
| 163 renderer_preferences_util::UpdateFromSystemSettings( | 153 renderer_preferences_util::UpdateFromSystemSettings( |
| 164 prefs, profile, web_contents()); | 154 prefs, profile, web_contents()); |
| 165 } | 155 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 web_contents, unsafe_resources[0].url, | 279 web_contents, unsafe_resources[0].url, |
| 290 GetReportingInfo(unsafe_resources), | 280 GetReportingInfo(unsafe_resources), |
| 291 GetSamplingEventName(GetInterstitialReason(unsafe_resources))); | 281 GetSamplingEventName(GetInterstitialReason(unsafe_resources))); |
| 292 | 282 |
| 293 return base::MakeUnique<SecurityInterstitialControllerClient>( | 283 return base::MakeUnique<SecurityInterstitialControllerClient>( |
| 294 web_contents, std::move(metrics_helper), profile->GetPrefs(), | 284 web_contents, std::move(metrics_helper), profile->GetPrefs(), |
| 295 ui_manager->app_locale(), ui_manager->default_safe_page()); | 285 ui_manager->app_locale(), ui_manager->default_safe_page()); |
| 296 } | 286 } |
| 297 | 287 |
| 298 } // namespace safe_browsing | 288 } // namespace safe_browsing |
| OLD | NEW |