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

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

Issue 7046063: Fix the user-action stats for the safe browsing interstitial so that it works in release builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698