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 // 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 PHISHING_PROCEED_CROSS_SITE, | 143 PHISHING_PROCEED_CROSS_SITE, |
144 MAX_DETAILED_ACTION | 144 MAX_DETAILED_ACTION |
145 }; | 145 }; |
146 | 146 |
147 void RecordDetailedUserAction(DetailedDecision decision) { | 147 void RecordDetailedUserAction(DetailedDecision decision) { |
148 UMA_HISTOGRAM_ENUMERATION("SB2.InterstitialActionDetails", | 148 UMA_HISTOGRAM_ENUMERATION("SB2.InterstitialActionDetails", |
149 decision, | 149 decision, |
150 MAX_DETAILED_ACTION); | 150 MAX_DETAILED_ACTION); |
151 } | 151 } |
152 | 152 |
| 153 // These are the constants for the M37 Finch trial. |
| 154 const char kV3StudyName[] = "MalwareInterstitialVersion"; |
| 155 const char kCondUseV2[] = "V2"; |
| 156 |
| 157 // Default to V3 unless a flag or field trial says otherwise. |
153 bool Version3Enabled() { | 158 bool Version3Enabled() { |
154 if (CommandLine::ForCurrentProcess()->HasSwitch( | 159 if (CommandLine::ForCurrentProcess()->HasSwitch( |
155 switches::kMalwareInterstitialVersionV3)) { | 160 switches::kMalwareInterstitialVersionV2)) { |
156 return true; | 161 return false; |
157 } | 162 } |
158 return false; | 163 if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondUseV2) |
| 164 return false; |
| 165 return true; |
159 } | 166 } |
160 | 167 |
161 } // namespace | 168 } // namespace |
162 | 169 |
163 // static | 170 // static |
164 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL; | 171 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL; |
165 | 172 |
166 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we | 173 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we |
167 // don't leak it. | 174 // don't leak it. |
168 class SafeBrowsingBlockingPageFactoryImpl | 175 class SafeBrowsingBlockingPageFactoryImpl |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, | 1343 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, |
1337 base::UTF8ToUTF16(url_.host()))); | 1344 base::UTF8ToUTF16(url_.host()))); |
1338 load_time_data->SetString( | 1345 load_time_data->SetString( |
1339 "explanationParagraph", | 1346 "explanationParagraph", |
1340 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, | 1347 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, |
1341 base::UTF8ToUTF16(url_.host()))); | 1348 base::UTF8ToUTF16(url_.host()))); |
1342 load_time_data->SetString( | 1349 load_time_data->SetString( |
1343 "finalParagraph", | 1350 "finalParagraph", |
1344 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); | 1351 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); |
1345 } | 1352 } |
OLD | NEW |