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

Side by Side Diff: components/safe_browsing/base_blocking_page.cc

Issue 2905343002: Show interstitial on a password on focus ping with PHISHING verdict. (Closed)
Patch Set: nit Created 3 years, 6 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/safe_browsing/base_blocking_page.h" 5 #include "components/safe_browsing/base_blocking_page.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 return "from_data_saver"; 258 return "from_data_saver";
259 case safe_browsing::ThreatSource::REMOTE: 259 case safe_browsing::ThreatSource::REMOTE:
260 case safe_browsing::ThreatSource::LOCAL_PVER3: 260 case safe_browsing::ThreatSource::LOCAL_PVER3:
261 // REMOTE and LOCAL_PVER3 can be distinguished in the logs 261 // REMOTE and LOCAL_PVER3 can be distinguished in the logs
262 // by platform type: Remote is mobile, local_pver3 is desktop. 262 // by platform type: Remote is mobile, local_pver3 is desktop.
263 return "from_device"; 263 return "from_device";
264 case safe_browsing::ThreatSource::LOCAL_PVER4: 264 case safe_browsing::ThreatSource::LOCAL_PVER4:
265 return "from_device_v4"; 265 return "from_device_v4";
266 case safe_browsing::ThreatSource::CLIENT_SIDE_DETECTION: 266 case safe_browsing::ThreatSource::CLIENT_SIDE_DETECTION:
267 return "from_client_side_detection"; 267 return "from_client_side_detection";
268 case safe_browsing::ThreatSource::PASSWORD_PROTECTION_SERVICE:
269 return "from_password_protection_service";
268 case safe_browsing::ThreatSource::UNKNOWN: 270 case safe_browsing::ThreatSource::UNKNOWN:
269 break; 271 break;
270 } 272 }
271 NOTREACHED(); 273 NOTREACHED();
272 return std::string(); 274 return std::string();
273 } 275 }
274 276
275 // static 277 // static
276 security_interstitials::BaseSafeBrowsingErrorUI::SBInterstitialReason 278 security_interstitials::BaseSafeBrowsingErrorUI::SBInterstitialReason
277 BaseBlockingPage::GetInterstitialReason( 279 BaseBlockingPage::GetInterstitialReason(
278 const UnsafeResourceList& unsafe_resources) { 280 const UnsafeResourceList& unsafe_resources) {
279 bool harmful = false; 281 bool harmful = false;
280 for (UnsafeResourceList::const_iterator iter = unsafe_resources.begin(); 282 for (UnsafeResourceList::const_iterator iter = unsafe_resources.begin();
281 iter != unsafe_resources.end(); ++iter) { 283 iter != unsafe_resources.end(); ++iter) {
282 const BaseUIManager::UnsafeResource& resource = *iter; 284 const BaseUIManager::UnsafeResource& resource = *iter;
283 safe_browsing::SBThreatType threat_type = resource.threat_type; 285 safe_browsing::SBThreatType threat_type = resource.threat_type;
284 if (threat_type == SB_THREAT_TYPE_URL_MALWARE || 286 if (threat_type == SB_THREAT_TYPE_URL_MALWARE ||
285 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) { 287 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) {
286 return BaseSafeBrowsingErrorUI::SB_REASON_MALWARE; 288 return BaseSafeBrowsingErrorUI::SB_REASON_MALWARE;
287 } else if (threat_type == SB_THREAT_TYPE_URL_UNWANTED) { 289 } else if (threat_type == SB_THREAT_TYPE_URL_UNWANTED) {
288 harmful = true; 290 harmful = true;
289 } else { 291 } else {
290 DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING || 292 DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING ||
291 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL); 293 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL ||
294 threat_type == SB_THREAT_TYPE_PASSWORD_PROTECTION_PHISHING_URL);
292 } 295 }
293 } 296 }
294 297
295 if (harmful) 298 if (harmful)
296 return BaseSafeBrowsingErrorUI::SB_REASON_HARMFUL; 299 return BaseSafeBrowsingErrorUI::SB_REASON_HARMFUL;
297 return BaseSafeBrowsingErrorUI::SB_REASON_PHISHING; 300 return BaseSafeBrowsingErrorUI::SB_REASON_PHISHING;
298 } 301 }
299 302
300 BaseUIManager* BaseBlockingPage::ui_manager() const { 303 BaseUIManager* BaseBlockingPage::ui_manager() const {
301 return ui_manager_; 304 return ui_manager_;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 int BaseBlockingPage::GetHTMLTemplateId() { 356 int BaseBlockingPage::GetHTMLTemplateId() {
354 return sb_error_ui_->GetHTMLTemplateId(); 357 return sb_error_ui_->GetHTMLTemplateId();
355 } 358 }
356 359
357 void BaseBlockingPage::set_sb_error_ui( 360 void BaseBlockingPage::set_sb_error_ui(
358 std::unique_ptr<BaseSafeBrowsingErrorUI> sb_error_ui) { 361 std::unique_ptr<BaseSafeBrowsingErrorUI> sb_error_ui) {
359 sb_error_ui_ = std::move(sb_error_ui); 362 sb_error_ui_ = std::move(sb_error_ui);
360 } 363 }
361 364
362 } // namespace safe_browsing 365 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.cc ('k') | components/safe_browsing/base_ping_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698