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

Side by Side Diff: chrome/browser/safe_browsing/ui_manager.cc

Issue 1488423002: Don't collect safebrowsing DOM details if the warning was main page load blocking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 (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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 SafeBrowsingUIManager::UnsafeResource::UnsafeResource() 67 SafeBrowsingUIManager::UnsafeResource::UnsafeResource()
68 : is_subresource(false), 68 : is_subresource(false),
69 threat_type(SB_THREAT_TYPE_SAFE), 69 threat_type(SB_THREAT_TYPE_SAFE),
70 render_process_host_id(-1), 70 render_process_host_id(-1),
71 render_view_id(-1), 71 render_view_id(-1),
72 threat_source(safe_browsing::ThreatSource::UNKNOWN) { 72 threat_source(safe_browsing::ThreatSource::UNKNOWN) {
73 } 73 }
74 74
75 SafeBrowsingUIManager::UnsafeResource::~UnsafeResource() { } 75 SafeBrowsingUIManager::UnsafeResource::~UnsafeResource() { }
76 76
77 bool SafeBrowsingUIManager::UnsafeResource::IsMainPageLoadBlocked() const {
78 // Subresource hits cannot happen until after main page load is committed.
79 if (is_subresource)
80 return false;
81
82 // Client-side phishing detection interstitials never block the main frame
83 // load, since they happen after the page is finished loading.
84 if (threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL ||
85 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) {
86 return false;
87 }
88
89 return true;
90 }
91
77 // SafeBrowsingUIManager ------------------------------------------------------- 92 // SafeBrowsingUIManager -------------------------------------------------------
78 93
79 SafeBrowsingUIManager::SafeBrowsingUIManager( 94 SafeBrowsingUIManager::SafeBrowsingUIManager(
80 const scoped_refptr<SafeBrowsingService>& service) 95 const scoped_refptr<SafeBrowsingService>& service)
81 : sb_service_(service) {} 96 : sb_service_(service) {}
82 97
83 SafeBrowsingUIManager::~SafeBrowsingUIManager() {} 98 SafeBrowsingUIManager::~SafeBrowsingUIManager() {}
84 99
85 void SafeBrowsingUIManager::StopOnIOThread(bool shutdown) { 100 void SafeBrowsingUIManager::StopOnIOThread(bool shutdown) {
86 DCHECK_CURRENTLY_ON(BrowserThread::IO); 101 DCHECK_CURRENTLY_ON(BrowserThread::IO);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 GURL maybe_whitelisted_url( 335 GURL maybe_whitelisted_url(
321 resource.is_subresource ? web_contents->GetVisibleURL() : resource.url); 336 resource.is_subresource ? web_contents->GetVisibleURL() : resource.url);
322 WhitelistUrlSet* site_list = 337 WhitelistUrlSet* site_list =
323 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey)); 338 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey));
324 if (!site_list) 339 if (!site_list)
325 return false; 340 return false;
326 return site_list->Contains(maybe_whitelisted_url); 341 return site_list->Contains(maybe_whitelisted_url);
327 } 342 }
328 343
329 } // namespace safe_browsing 344 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698