| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Implementation of the SafeBrowsingBlockingPage class. | 5 // Implementation of the SafeBrowsingBlockingPage class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 582 |
| 583 void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) { | 583 void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) { |
| 584 // Determine the interstitial type from the blocked resources. | 584 // Determine the interstitial type from the blocked resources. |
| 585 // This is the same logic that is used to actually construct the | 585 // This is the same logic that is used to actually construct the |
| 586 // page contents; we can look at the title to see which type of | 586 // page contents; we can look at the title to see which type of |
| 587 // interstitial is being displayed. | 587 // interstitial is being displayed. |
| 588 DictionaryValue strings; | 588 DictionaryValue strings; |
| 589 PopulateMultipleThreatStringDictionary(&strings); | 589 PopulateMultipleThreatStringDictionary(&strings); |
| 590 | 590 |
| 591 string16 title; | 591 string16 title; |
| 592 DCHECK(strings.GetString("title", &title)); | 592 bool success = strings.GetString("title", &title); |
| 593 DCHECK(success); |
| 593 | 594 |
| 594 std::string action = "SBInterstitial"; | 595 std::string action = "SBInterstitial"; |
| 595 if (title == | 596 if (title == |
| 596 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MULTI_THREAT_TITLE)) { | 597 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MULTI_THREAT_TITLE)) { |
| 597 action.append("Multiple"); | 598 action.append("Multiple"); |
| 598 } else if (title == | 599 } else if (title == |
| 599 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_TITLE)) { | 600 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_TITLE)) { |
| 600 action.append("Malware"); | 601 action.append("Malware"); |
| 601 } else { | 602 } else { |
| 602 DCHECK_EQ(title, | 603 DCHECK_EQ(title, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 // Client-side phishing detection interstitials never block the main frame | 702 // Client-side phishing detection interstitials never block the main frame |
| 702 // load, since they happen after the page is finished loading. | 703 // load, since they happen after the page is finished loading. |
| 703 if (unsafe_resources[0].threat_type == | 704 if (unsafe_resources[0].threat_type == |
| 704 SafeBrowsingService::CLIENT_SIDE_PHISHING_URL) { | 705 SafeBrowsingService::CLIENT_SIDE_PHISHING_URL) { |
| 705 return false; | 706 return false; |
| 706 } | 707 } |
| 707 | 708 |
| 708 // Otherwise, check the threat type. | 709 // Otherwise, check the threat type. |
| 709 return unsafe_resources.size() == 1 && !unsafe_resources[0].is_subresource; | 710 return unsafe_resources.size() == 1 && !unsafe_resources[0].is_subresource; |
| 710 } | 711 } |
| OLD | NEW |