| Index: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
|
| diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
|
| index 032d5eceab5296580fbec821803a52e81f08e190..d3e6e10135b020b95971a9ae4e5339b15db1cf9e 100644
|
| --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
|
| +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
|
| @@ -113,6 +113,22 @@ static const char* const kExpandedSeeMore = "expandedSeeMore";
|
| // RecordUserReactionTime.
|
| static const char* const kNavigatedAwayMetaCommand = "closed";
|
|
|
| +// These are the conditions for the summer 2013 Finch experiment.
|
| +static const char kCond1MalwareControl[] = "Cond1MalwareControl";
|
| +static const char kCond2MalwareNoBrand[] = "Cond2MalwareNoBrand";
|
| +static const char kCond3PhishingControl[] = "Cond3PhishingControl";
|
| +static const char kCond4PhishingNoBrand[] = "Cond4PhishingNoBrand";
|
| +static const char kCond5MalwareOneStep[] = "Cond5MalwareOneStep";
|
| +static const char kCond6PhishingOneStep[] = "Cond6PhishingOneStep";
|
| +static const char kCond7MalwareFearMsg[] = "Cond7MalwareFearMsg";
|
| +static const char kCond8PhishingFearMsg[] = "Cond8PhishingFearMsg";
|
| +static const char kCond9MalwareCollabMsg[] = "Cond9MalwareCollabMsg";
|
| +static const char kCond10PhishingCollabMsg[] = "Cond10PhishingCollabMsg";
|
| +static const char kCond11MalwareQuestion[] = "Cond11MalwareQuestion";
|
| +static const char kCond12PhishingQuestion[] = "Cond12PhishingQuestion";
|
| +static const char kCond13MalwareGoBack[] = "Cond13MalwareGoBack";
|
| +static const char kCond14PhishingGoBack[] = "Cond14PhishingGoBack";
|
| +
|
| // static
|
| SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL;
|
|
|
| @@ -129,7 +145,7 @@ class SafeBrowsingBlockingPageFactoryImpl
|
| WebContents* web_contents,
|
| const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources)
|
| OVERRIDE {
|
| - // Only do the trial if the interstitial is for a single malware or
|
| + // Only use the V2 page if the interstitial is for a single malware or
|
| // phishing resource, the multi-threat interstitial has not been updated to
|
| // V2 yet.
|
| if (unsafe_resources.size() == 1 &&
|
| @@ -378,6 +394,8 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) {
|
| }
|
|
|
| if (command == kExpandedSeeMore) {
|
| + if (!has_expanded_see_more_section_) // Toggled in RecordUserReactionTime.
|
| + RecordUserAction(SHOW_ADVANCED);
|
| // User expanded the "see more info" section of the page. We don't actually
|
| // do any action based on this, it's just so that RecordUserReactionTime can
|
| // track it.
|
| @@ -483,6 +501,9 @@ void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) {
|
| PHISHING_DONT_PROCEED,
|
| PHISHING_FORCED_DONT_PROCEED,
|
| PHISHING_PROCEED,
|
| + MALWARE_SHOW_ADVANCED,
|
| + MULTIPLE_SHOW_ADVANCED,
|
| + PHISHING_SHOW_ADVANCED,
|
| MAX_ACTION
|
| } histogram_action = MAX_ACTION;
|
|
|
| @@ -540,6 +561,19 @@ void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) {
|
| }
|
| }
|
| break;
|
| + case SHOW_ADVANCED:
|
| + switch (interstitial_type_) {
|
| + case TYPE_MALWARE_AND_PHISHING:
|
| + histogram_action = MULTIPLE_SHOW_ADVANCED;
|
| + break;
|
| + case TYPE_MALWARE:
|
| + histogram_action = MALWARE_SHOW_ADVANCED;
|
| + break;
|
| + case TYPE_PHISHING:
|
| + histogram_action = PHISHING_SHOW_ADVANCED;
|
| + break;
|
| + }
|
| + break;
|
| default:
|
| NOTREACHED() << "Unexpected event: " << event;
|
| }
|
| @@ -891,6 +925,14 @@ SafeBrowsingBlockingPageV2::SafeBrowsingBlockingPageV2(
|
| WebContents* web_contents,
|
| const UnsafeResourceList& unsafe_resources)
|
| : SafeBrowsingBlockingPage(ui_manager, web_contents, unsafe_resources) {
|
| + if (unsafe_resources_[0].threat_type == SB_THREAT_TYPE_URL_MALWARE) {
|
| + trial_ = base::FieldTrialList::FindFullName("InterstitialMalware");
|
| + } else if (unsafe_resources_[0].threat_type ==
|
| + SB_THREAT_TYPE_URL_PHISHING ||
|
| + unsafe_resources_[0].threat_type ==
|
| + SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) {
|
| + trial_ = base::FieldTrialList::FindFullName("InterstitialPhishing");
|
| + }
|
| }
|
|
|
| std::string SafeBrowsingBlockingPageV2::GetHTMLContents() {
|
| @@ -947,6 +989,7 @@ void SafeBrowsingBlockingPageV2::PopulateStringDictionary(
|
| IDS_SAFE_BROWSING_MALWARE_V2_SEE_MORE));
|
| strings->SetString("proceed",
|
| l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_PROCEED_LINK));
|
| + strings->SetString("trialType", trial_); // Finch trial
|
|
|
| webui::SetFontAndTextDirection(strings);
|
| }
|
|
|