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 25 matching lines...) Expand all Loading... |
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/malware detection and password protection phishing | 43 // Client-side phishing/malware detection and password protection phishing |
44 // interstitials never block the main frame load, since they happen after the | 44 // interstitials never block the main frame load, since they happen after the |
45 // page is finished loading. | 45 // page is finished loading. |
46 if (threat_type == safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 46 if (threat_type == safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING || |
47 threat_type == safe_browsing::SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL || | 47 threat_type == safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE || |
48 threat_type == | 48 threat_type == |
49 safe_browsing::SB_THREAT_TYPE_PASSWORD_PROTECTION_PHISHING_URL) { | 49 safe_browsing::SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING) { |
50 return false; | 50 return false; |
51 } | 51 } |
52 | 52 |
53 return true; | 53 return true; |
54 } | 54 } |
55 | 55 |
56 content::NavigationEntry* | 56 content::NavigationEntry* |
57 UnsafeResource::GetNavigationEntryForResource() const { | 57 UnsafeResource::GetNavigationEntryForResource() const { |
58 content::WebContents* web_contents = web_contents_getter.Run(); | 58 content::WebContents* web_contents = web_contents_getter.Run(); |
59 if (!web_contents) | 59 if (!web_contents) |
(...skipping 13 matching lines...) Expand all Loading... |
73 // static | 73 // static |
74 base::Callback<content::WebContents*(void)> | 74 base::Callback<content::WebContents*(void)> |
75 UnsafeResource::GetWebContentsGetter( | 75 UnsafeResource::GetWebContentsGetter( |
76 int render_process_host_id, | 76 int render_process_host_id, |
77 int render_frame_id) { | 77 int render_frame_id) { |
78 return base::Bind(&GetWebContentsByFrameID, render_process_host_id, | 78 return base::Bind(&GetWebContentsByFrameID, render_process_host_id, |
79 render_frame_id); | 79 render_frame_id); |
80 } | 80 } |
81 | 81 |
82 } // security_interstitials | 82 } // security_interstitials |
OLD | NEW |