| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/safe_browsing/ui_manager.h" | 5 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/debug/leak_tracker.h" | 10 #include "base/debug/leak_tracker.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // SafeBrowsingUIManager::UnsafeResource --------------------------------------- | 67 // SafeBrowsingUIManager::UnsafeResource --------------------------------------- |
| 68 | 68 |
| 69 SafeBrowsingUIManager::UnsafeResource::UnsafeResource() | 69 SafeBrowsingUIManager::UnsafeResource::UnsafeResource() |
| 70 : is_subresource(false), | 70 : is_subresource(false), |
| 71 threat_type(SB_THREAT_TYPE_SAFE), | 71 threat_type(SB_THREAT_TYPE_SAFE), |
| 72 render_process_host_id(-1), | 72 render_process_host_id(-1), |
| 73 render_frame_id(MSG_ROUTING_NONE), | 73 render_frame_id(MSG_ROUTING_NONE), |
| 74 threat_source(safe_browsing::ThreatSource::UNKNOWN) {} | 74 threat_source(safe_browsing::ThreatSource::UNKNOWN) {} |
| 75 | 75 |
| 76 SafeBrowsingUIManager::UnsafeResource::UnsafeResource( |
| 77 const UnsafeResource& other) = default; |
| 78 |
| 76 SafeBrowsingUIManager::UnsafeResource::~UnsafeResource() { } | 79 SafeBrowsingUIManager::UnsafeResource::~UnsafeResource() { } |
| 77 | 80 |
| 78 bool SafeBrowsingUIManager::UnsafeResource::IsMainPageLoadBlocked() const { | 81 bool SafeBrowsingUIManager::UnsafeResource::IsMainPageLoadBlocked() const { |
| 79 // Subresource hits cannot happen until after main page load is committed. | 82 // Subresource hits cannot happen until after main page load is committed. |
| 80 if (is_subresource) | 83 if (is_subresource) |
| 81 return false; | 84 return false; |
| 82 | 85 |
| 83 // Client-side phishing detection interstitials never block the main frame | 86 // Client-side phishing detection interstitials never block the main frame |
| 84 // load, since they happen after the page is finished loading. | 87 // load, since they happen after the page is finished loading. |
| 85 if (threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 88 if (threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 365 } |
| 363 | 366 |
| 364 WhitelistUrlSet* site_list = | 367 WhitelistUrlSet* site_list = |
| 365 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey)); | 368 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey)); |
| 366 if (!site_list) | 369 if (!site_list) |
| 367 return false; | 370 return false; |
| 368 return site_list->Contains(maybe_whitelisted_url); | 371 return site_list->Contains(maybe_whitelisted_url); |
| 369 } | 372 } |
| 370 | 373 |
| 371 } // namespace safe_browsing | 374 } // namespace safe_browsing |
| OLD | NEW |