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

Unified Diff: chrome/browser/safe_browsing/ui_manager.cc

Issue 2270283002: Downgrade security state after user clicks through SB interstitial (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove logging statements Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.h ('k') | chrome/browser/ssl/chrome_security_state_model_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/ui_manager.cc
diff --git a/chrome/browser/safe_browsing/ui_manager.cc b/chrome/browser/safe_browsing/ui_manager.cc
index cfb91cc27255ead1de1155bd6234d33a5fee8b16..e056eef78878dc458fd9e2397884ba7fb96f4bc6 100644
--- a/chrome/browser/safe_browsing/ui_manager.cc
+++ b/chrome/browser/safe_browsing/ui_manager.cc
@@ -371,23 +371,36 @@ void SafeBrowsingUIManager::AddToWhitelist(const UnsafeResource& resource) {
site_list->Insert(whitelisted_url);
}
+bool SafeBrowsingUIManager::IsWhitelisted(const UnsafeResource& resource) {
+ NavigationEntry* entry = nullptr;
+ if (resource.is_subresource) {
+ entry = resource.GetNavigationEntryForResource();
+ }
+ return IsUrlWhitelistedForWebContents(resource.url, resource.is_subresource,
+ entry,
+ resource.web_contents_getter.Run());
+}
+
// Check if the user has already ignored a SB warning for this WebContents and
// top-level domain.
-bool SafeBrowsingUIManager::IsWhitelisted(const UnsafeResource& resource) {
+bool SafeBrowsingUIManager::IsUrlWhitelistedForWebContents(
+ const GURL& url,
+ bool is_subresource,
+ NavigationEntry* entry,
+ content::WebContents* web_contents) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
GURL maybe_whitelisted_url;
- if (resource.is_subresource) {
- NavigationEntry* entry = resource.GetNavigationEntryForResource();
+ if (is_subresource) {
if (!entry)
return false;
maybe_whitelisted_url = entry->GetURL();
} else {
- maybe_whitelisted_url = resource.url;
+ maybe_whitelisted_url = url;
}
- WhitelistUrlSet* site_list = static_cast<WhitelistUrlSet*>(
- resource.web_contents_getter.Run()->GetUserData(kWhitelistKey));
+ WhitelistUrlSet* site_list =
+ static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey));
if (!site_list)
return false;
return site_list->Contains(maybe_whitelisted_url);
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.h ('k') | chrome/browser/ssl/chrome_security_state_model_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698