| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ssl/security_state_tab_helper.h" | 5 #include "chrome/browser/ssl/security_state_tab_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 scoped_refptr<SafeBrowsingUIManager> sb_ui_manager = sb_service->ui_manager(); | 158 scoped_refptr<SafeBrowsingUIManager> sb_ui_manager = sb_service->ui_manager(); |
| 159 safe_browsing::SBThreatType threat_type; | 159 safe_browsing::SBThreatType threat_type; |
| 160 if (sb_ui_manager->IsUrlWhitelistedOrPendingForWebContents( | 160 if (sb_ui_manager->IsUrlWhitelistedOrPendingForWebContents( |
| 161 entry->GetURL(), false, entry, web_contents(), false, &threat_type)) { | 161 entry->GetURL(), false, entry, web_contents(), false, &threat_type)) { |
| 162 switch (threat_type) { | 162 switch (threat_type) { |
| 163 case safe_browsing::SB_THREAT_TYPE_UNUSED: | 163 case safe_browsing::SB_THREAT_TYPE_UNUSED: |
| 164 case safe_browsing::SB_THREAT_TYPE_SAFE: | 164 case safe_browsing::SB_THREAT_TYPE_SAFE: |
| 165 break; | 165 break; |
| 166 case safe_browsing::SB_THREAT_TYPE_URL_PHISHING: | 166 case safe_browsing::SB_THREAT_TYPE_URL_PHISHING: |
| 167 case safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL: | 167 case safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL: |
| 168 case safe_browsing::SB_THREAT_TYPE_PASSWORD_PROTECTION_PHISHING_URL: |
| 168 return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING; | 169 return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING; |
| 169 break; | 170 break; |
| 170 case safe_browsing::SB_THREAT_TYPE_URL_MALWARE: | 171 case safe_browsing::SB_THREAT_TYPE_URL_MALWARE: |
| 171 case safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL: | 172 case safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL: |
| 172 return security_state::MALICIOUS_CONTENT_STATUS_MALWARE; | 173 return security_state::MALICIOUS_CONTENT_STATUS_MALWARE; |
| 173 break; | 174 break; |
| 174 case safe_browsing::SB_THREAT_TYPE_URL_UNWANTED: | 175 case safe_browsing::SB_THREAT_TYPE_URL_UNWANTED: |
| 175 return security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE; | 176 return security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE; |
| 176 break; | 177 break; |
| 177 case safe_browsing::SB_THREAT_TYPE_BINARY_MALWARE_URL: | 178 case safe_browsing::SB_THREAT_TYPE_BINARY_MALWARE_URL: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 193 std::unique_ptr<security_state::VisibleSecurityState> | 194 std::unique_ptr<security_state::VisibleSecurityState> |
| 194 SecurityStateTabHelper::GetVisibleSecurityState() const { | 195 SecurityStateTabHelper::GetVisibleSecurityState() const { |
| 195 auto state = security_state::GetVisibleSecurityState(web_contents()); | 196 auto state = security_state::GetVisibleSecurityState(web_contents()); |
| 196 | 197 |
| 197 // Malware status might already be known even if connection security | 198 // Malware status might already be known even if connection security |
| 198 // information is still being initialized, thus no need to check for that. | 199 // information is still being initialized, thus no need to check for that. |
| 199 state->malicious_content_status = GetMaliciousContentStatus(); | 200 state->malicious_content_status = GetMaliciousContentStatus(); |
| 200 | 201 |
| 201 return state; | 202 return state; |
| 202 } | 203 } |
| OLD | NEW |