| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/security_interstitials/content/unsafe_resource.h" | 5 #include "components/security_interstitials/content/unsafe_resource.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/public/browser/navigation_entry.h" | 8 #include "content/public/browser/navigation_entry.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 UnsafeResource::UnsafeResource( | 33 UnsafeResource::UnsafeResource( |
| 34 const UnsafeResource& other) = default; | 34 const UnsafeResource& other) = default; |
| 35 | 35 |
| 36 UnsafeResource::~UnsafeResource() {} | 36 UnsafeResource::~UnsafeResource() {} |
| 37 | 37 |
| 38 bool UnsafeResource::IsMainPageLoadBlocked() const { | 38 bool UnsafeResource::IsMainPageLoadBlocked() const { |
| 39 // Subresource hits cannot happen until after main page load is committed. | 39 // Subresource hits cannot happen until after main page load is committed. |
| 40 if (is_subresource) | 40 if (is_subresource) |
| 41 return false; | 41 return false; |
| 42 | 42 |
| 43 // Client-side phishing detection interstitials never block the main frame | 43 // Client-side phishing/malware detection and password protection phishing |
| 44 // load, since they happen after the page is finished loading. | 44 // interstitials never block the main frame load, since they happen after the |
| 45 // page is finished loading. |
| 45 if (threat_type == safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 46 if (threat_type == safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || |
| 46 threat_type == safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) { | 47 threat_type == safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL || |
| 48 threat_type == |
| 49 safe_browsing::SB_THREAT_TYPE_PASSWORD_PROTECTION_PHISHING_URL) { |
| 47 return false; | 50 return false; |
| 48 } | 51 } |
| 49 | 52 |
| 50 return true; | 53 return true; |
| 51 } | 54 } |
| 52 | 55 |
| 53 content::NavigationEntry* | 56 content::NavigationEntry* |
| 54 UnsafeResource::GetNavigationEntryForResource() const { | 57 UnsafeResource::GetNavigationEntryForResource() const { |
| 55 content::WebContents* web_contents = web_contents_getter.Run(); | 58 content::WebContents* web_contents = web_contents_getter.Run(); |
| 56 if (!web_contents) | 59 if (!web_contents) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 70 // static | 73 // static |
| 71 base::Callback<content::WebContents*(void)> | 74 base::Callback<content::WebContents*(void)> |
| 72 UnsafeResource::GetWebContentsGetter( | 75 UnsafeResource::GetWebContentsGetter( |
| 73 int render_process_host_id, | 76 int render_process_host_id, |
| 74 int render_frame_id) { | 77 int render_frame_id) { |
| 75 return base::Bind(&GetWebContentsByFrameID, render_process_host_id, | 78 return base::Bind(&GetWebContentsByFrameID, render_process_host_id, |
| 76 render_frame_id); | 79 render_frame_id); |
| 77 } | 80 } |
| 78 | 81 |
| 79 } // security_interstitials | 82 } // security_interstitials |
| OLD | NEW |