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

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

Issue 2925693003: Making CSD ReportType enum consistent. (Closed)
Patch Set: Handling SBThreatType enums as well 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // static 276 // static
277 security_interstitials::BaseSafeBrowsingErrorUI::SBInterstitialReason 277 security_interstitials::BaseSafeBrowsingErrorUI::SBInterstitialReason
278 BaseBlockingPage::GetInterstitialReason( 278 BaseBlockingPage::GetInterstitialReason(
279 const UnsafeResourceList& unsafe_resources) { 279 const UnsafeResourceList& unsafe_resources) {
280 bool harmful = false; 280 bool harmful = false;
281 for (UnsafeResourceList::const_iterator iter = unsafe_resources.begin(); 281 for (UnsafeResourceList::const_iterator iter = unsafe_resources.begin();
282 iter != unsafe_resources.end(); ++iter) { 282 iter != unsafe_resources.end(); ++iter) {
283 const BaseUIManager::UnsafeResource& resource = *iter; 283 const BaseUIManager::UnsafeResource& resource = *iter;
284 safe_browsing::SBThreatType threat_type = resource.threat_type; 284 safe_browsing::SBThreatType threat_type = resource.threat_type;
285 if (threat_type == SB_THREAT_TYPE_URL_MALWARE || 285 if (threat_type == SB_THREAT_TYPE_URL_MALWARE ||
286 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) { 286 threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE) {
287 return BaseSafeBrowsingErrorUI::SB_REASON_MALWARE; 287 return BaseSafeBrowsingErrorUI::SB_REASON_MALWARE;
288 } else if (threat_type == SB_THREAT_TYPE_URL_UNWANTED) { 288 } else if (threat_type == SB_THREAT_TYPE_URL_UNWANTED) {
289 harmful = true; 289 harmful = true;
290 } else { 290 } else {
291 DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING || 291 DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING ||
292 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || 292 threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING ||
293 threat_type == SB_THREAT_TYPE_PASSWORD_PROTECTION_PHISHING_URL); 293 threat_type == SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING);
294 } 294 }
295 } 295 }
296 296
297 if (harmful) 297 if (harmful)
298 return BaseSafeBrowsingErrorUI::SB_REASON_HARMFUL; 298 return BaseSafeBrowsingErrorUI::SB_REASON_HARMFUL;
299 return BaseSafeBrowsingErrorUI::SB_REASON_PHISHING; 299 return BaseSafeBrowsingErrorUI::SB_REASON_PHISHING;
300 } 300 }
301 301
302 BaseUIManager* BaseBlockingPage::ui_manager() const { 302 BaseUIManager* BaseBlockingPage::ui_manager() const {
303 return ui_manager_; 303 return ui_manager_;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 int BaseBlockingPage::GetHTMLTemplateId() { 355 int BaseBlockingPage::GetHTMLTemplateId() {
356 return sb_error_ui_->GetHTMLTemplateId(); 356 return sb_error_ui_->GetHTMLTemplateId();
357 } 357 }
358 358
359 void BaseBlockingPage::set_sb_error_ui( 359 void BaseBlockingPage::set_sb_error_ui(
360 std::unique_ptr<BaseSafeBrowsingErrorUI> sb_error_ui) { 360 std::unique_ptr<BaseSafeBrowsingErrorUI> sb_error_ui) {
361 sb_error_ui_ = std::move(sb_error_ui); 361 sb_error_ui_ = std::move(sb_error_ui);
362 } 362 }
363 363
364 } // namespace safe_browsing 364 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/interstitials/interstitial_ui.cc ('k') | components/safe_browsing/base_ping_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698