| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 whitelisted_url = entry->GetURL(); | 382 whitelisted_url = entry->GetURL(); |
| 383 } else { | 383 } else { |
| 384 whitelisted_url = resource.url; | 384 whitelisted_url = resource.url; |
| 385 } | 385 } |
| 386 | 386 |
| 387 if (pending) { | 387 if (pending) { |
| 388 site_list->InsertPending(whitelisted_url); | 388 site_list->InsertPending(whitelisted_url); |
| 389 } else { | 389 } else { |
| 390 site_list->Insert(whitelisted_url); | 390 site_list->Insert(whitelisted_url); |
| 391 } | 391 } |
| 392 |
| 393 // Notify security UI that security state has changed. |
| 394 web_contents->DidChangeVisibleSecurityState(); |
| 392 } | 395 } |
| 393 | 396 |
| 394 bool SafeBrowsingUIManager::IsWhitelisted(const UnsafeResource& resource) { | 397 bool SafeBrowsingUIManager::IsWhitelisted(const UnsafeResource& resource) { |
| 395 NavigationEntry* entry = nullptr; | 398 NavigationEntry* entry = nullptr; |
| 396 if (resource.is_subresource) { | 399 if (resource.is_subresource) { |
| 397 entry = resource.GetNavigationEntryForResource(); | 400 entry = resource.GetNavigationEntryForResource(); |
| 398 } | 401 } |
| 399 return IsUrlWhitelistedOrPendingForWebContents( | 402 return IsUrlWhitelistedOrPendingForWebContents( |
| 400 resource.url, resource.is_subresource, entry, | 403 resource.url, resource.is_subresource, entry, |
| 401 resource.web_contents_getter.Run(), true); | 404 resource.web_contents_getter.Run(), true); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 427 | 430 |
| 428 bool whitelisted = site_list->Contains(lookup_url); | 431 bool whitelisted = site_list->Contains(lookup_url); |
| 429 if (whitelist_only) { | 432 if (whitelist_only) { |
| 430 return whitelisted; | 433 return whitelisted; |
| 431 } else { | 434 } else { |
| 432 return whitelisted || site_list->ContainsPending(lookup_url); | 435 return whitelisted || site_list->ContainsPending(lookup_url); |
| 433 } | 436 } |
| 434 } | 437 } |
| 435 | 438 |
| 436 } // namespace safe_browsing | 439 } // namespace safe_browsing |
| OLD | NEW |