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