| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 const char kSbDiagnosticUrl[] = | 61 const char kSbDiagnosticUrl[] = |
| 62 "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%s&clie
nt=chromium"; | 62 "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%s&clie
nt=chromium"; |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 // URL for malware and phishing, V2. | 65 // URL for malware and phishing, V2. |
| 66 const char kLearnMoreMalwareUrlV2[] = | 66 const char kLearnMoreMalwareUrlV2[] = |
| 67 "https://www.google.com/transparencyreport/safebrowsing/"; | 67 "https://www.google.com/transparencyreport/safebrowsing/"; |
| 68 const char kLearnMorePhishingUrlV2[] = | 68 const char kLearnMorePhishingUrlV2[] = |
| 69 "https://www.google.com/transparencyreport/safebrowsing/"; | 69 "https://www.google.com/transparencyreport/safebrowsing/"; |
| 70 | 70 |
| 71 const char kPrivacyLinkHtml[] = | |
| 72 "<a id=\"privacy-link\" href=\"\" onclick=\"sendCommand(%d); " | |
| 73 "return false;\" onmousedown=\"return false;\">%s</a>"; | |
| 74 | |
| 75 // After a malware interstitial where the user opted-in to the report | 71 // After a malware interstitial where the user opted-in to the report |
| 76 // but clicked "proceed anyway", we delay the call to | 72 // but clicked "proceed anyway", we delay the call to |
| 77 // MalwareDetails::FinishCollection() by this much time (in | 73 // MalwareDetails::FinishCollection() by this much time (in |
| 78 // milliseconds). | 74 // milliseconds). |
| 79 const int64 kMalwareDetailsProceedDelayMilliSeconds = 3000; | 75 const int64 kMalwareDetailsProceedDelayMilliSeconds = 3000; |
| 80 | 76 |
| 81 // Other constants used to communicate with the JavaScript. | |
| 82 const char kBoxChecked[] = "boxchecked"; | |
| 83 const char kDisplayCheckBox[] = "displaycheckbox"; | |
| 84 | |
| 85 // Constants for the Experience Sampling instrumentation. | 77 // Constants for the Experience Sampling instrumentation. |
| 86 const char kEventNameMalware[] = "safebrowsing_interstitial_"; | 78 const char kEventNameMalware[] = "safebrowsing_interstitial_"; |
| 87 const char kEventNameHarmful[] = "harmful_interstitial_"; | 79 const char kEventNameHarmful[] = "harmful_interstitial_"; |
| 88 const char kEventNamePhishing[] = "phishing_interstitial_"; | 80 const char kEventNamePhishing[] = "phishing_interstitial_"; |
| 89 const char kEventNameOther[] = "safebrowsing_other_interstitial_"; | 81 const char kEventNameOther[] = "safebrowsing_other_interstitial_"; |
| 90 | 82 |
| 91 base::LazyInstance<SafeBrowsingBlockingPage::UnsafeResourceMap> | 83 base::LazyInstance<SafeBrowsingBlockingPage::UnsafeResourceMap> |
| 92 g_unsafe_resource_map = LAZY_INSTANCE_INITIALIZER; | 84 g_unsafe_resource_map = LAZY_INSTANCE_INITIALIZER; |
| 93 | 85 |
| 94 } // namespace | 86 } // namespace |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 DCHECK(phishing || malware || harmful); | 152 DCHECK(phishing || malware || harmful); |
| 161 if (malware) | 153 if (malware) |
| 162 interstitial_reason_ = SB_REASON_MALWARE; | 154 interstitial_reason_ = SB_REASON_MALWARE; |
| 163 else if (harmful) | 155 else if (harmful) |
| 164 interstitial_reason_ = SB_REASON_HARMFUL; | 156 interstitial_reason_ = SB_REASON_HARMFUL; |
| 165 else | 157 else |
| 166 interstitial_reason_ = SB_REASON_PHISHING; | 158 interstitial_reason_ = SB_REASON_PHISHING; |
| 167 | 159 |
| 168 // This must be done after calculating |interstitial_reason_| above. | 160 // This must be done after calculating |interstitial_reason_| above. |
| 169 // Use same prefix for UMA as for Rappor. | 161 // Use same prefix for UMA as for Rappor. |
| 170 metrics_helper_.reset(new SecurityInterstitialMetricsHelper( | 162 set_metrics_helper(new SecurityInterstitialMetricsHelper( |
| 171 web_contents, request_url(), GetMetricPrefix(), GetMetricPrefix(), | 163 web_contents, request_url(), GetMetricPrefix(), GetMetricPrefix(), |
| 172 SecurityInterstitialMetricsHelper::REPORT_RAPPOR, | 164 SecurityInterstitialMetricsHelper::REPORT_RAPPOR, |
| 173 GetSamplingEventName())); | 165 GetSamplingEventName())); |
| 174 metrics_helper_->RecordUserDecision(SecurityInterstitialMetricsHelper::SHOW); | 166 metrics_helper()->RecordUserDecision(SecurityInterstitialMetricsHelper::SHOW); |
| 175 metrics_helper_->RecordUserInteraction( | 167 metrics_helper()->RecordUserInteraction( |
| 176 SecurityInterstitialMetricsHelper::TOTAL_VISITS); | 168 SecurityInterstitialMetricsHelper::TOTAL_VISITS); |
| 177 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { | 169 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { |
| 178 metrics_helper_->RecordUserDecision( | 170 metrics_helper()->RecordUserDecision( |
| 179 SecurityInterstitialMetricsHelper::PROCEEDING_DISABLED); | 171 SecurityInterstitialMetricsHelper::PROCEEDING_DISABLED); |
| 180 } | 172 } |
| 181 | 173 |
| 182 if (!is_main_frame_load_blocked_) { | 174 if (!is_main_frame_load_blocked_) { |
| 183 navigation_entry_index_to_remove_ = | 175 navigation_entry_index_to_remove_ = |
| 184 web_contents->GetController().GetLastCommittedEntryIndex(); | 176 web_contents->GetController().GetLastCommittedEntryIndex(); |
| 185 } else { | 177 } else { |
| 186 navigation_entry_index_to_remove_ = -1; | 178 navigation_entry_index_to_remove_ = -1; |
| 187 } | 179 } |
| 188 | 180 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 SetReportingPreference(true); | 216 SetReportingPreference(true); |
| 225 break; | 217 break; |
| 226 } | 218 } |
| 227 case CMD_DONT_REPORT: { | 219 case CMD_DONT_REPORT: { |
| 228 // User disabled SB Extended Reporting via the checkbox. | 220 // User disabled SB Extended Reporting via the checkbox. |
| 229 SetReportingPreference(false); | 221 SetReportingPreference(false); |
| 230 break; | 222 break; |
| 231 } | 223 } |
| 232 case CMD_OPEN_HELP_CENTER: { | 224 case CMD_OPEN_HELP_CENTER: { |
| 233 // User pressed "Learn more". | 225 // User pressed "Learn more". |
| 234 metrics_helper_->RecordUserInteraction( | 226 metrics_helper()->RecordUserInteraction( |
| 235 SecurityInterstitialMetricsHelper::SHOW_LEARN_MORE); | 227 SecurityInterstitialMetricsHelper::SHOW_LEARN_MORE); |
| 236 GURL learn_more_url( | 228 GURL learn_more_url( |
| 237 interstitial_reason_ == SB_REASON_PHISHING ? | 229 interstitial_reason_ == SB_REASON_PHISHING ? |
| 238 kLearnMorePhishingUrlV2 : kLearnMoreMalwareUrlV2); | 230 kLearnMorePhishingUrlV2 : kLearnMoreMalwareUrlV2); |
| 239 learn_more_url = google_util::AppendGoogleLocaleParam( | 231 learn_more_url = google_util::AppendGoogleLocaleParam( |
| 240 learn_more_url, g_browser_process->GetApplicationLocale()); | 232 learn_more_url, g_browser_process->GetApplicationLocale()); |
| 241 OpenURLParams params(learn_more_url, | 233 OpenURLParams params(learn_more_url, |
| 242 Referrer(), | 234 Referrer(), |
| 243 CURRENT_TAB, | 235 CURRENT_TAB, |
| 244 ui::PAGE_TRANSITION_LINK, | 236 ui::PAGE_TRANSITION_LINK, |
| 245 false); | 237 false); |
| 246 web_contents()->OpenURL(params); | 238 web_contents()->OpenURL(params); |
| 247 break; | 239 break; |
| 248 } | 240 } |
| 249 case CMD_OPEN_REPORTING_PRIVACY: { | 241 case CMD_OPEN_REPORTING_PRIVACY: { |
| 250 // User pressed on the SB Extended Reporting "privacy policy" link. | 242 // User pressed on the SB Extended Reporting "privacy policy" link. |
| 251 metrics_helper_->RecordUserInteraction( | 243 OpenExtendedReportingPrivacyPolicy(); |
| 252 SecurityInterstitialMetricsHelper::SHOW_PRIVACY_POLICY); | |
| 253 GURL privacy_url( | |
| 254 l10n_util::GetStringUTF8(IDS_SAFE_BROWSING_PRIVACY_POLICY_URL)); | |
| 255 privacy_url = google_util::AppendGoogleLocaleParam( | |
| 256 privacy_url, g_browser_process->GetApplicationLocale()); | |
| 257 OpenURLParams params(privacy_url, | |
| 258 Referrer(), | |
| 259 CURRENT_TAB, | |
| 260 ui::PAGE_TRANSITION_LINK, | |
| 261 false); | |
| 262 web_contents()->OpenURL(params); | |
| 263 break; | 244 break; |
| 264 } | 245 } |
| 265 case CMD_PROCEED: { | 246 case CMD_PROCEED: { |
| 266 // User pressed on the button to proceed. | 247 // User pressed on the button to proceed. |
| 267 if (!IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { | 248 if (!IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { |
| 268 metrics_helper_->RecordUserDecision( | 249 metrics_helper()->RecordUserDecision( |
| 269 SecurityInterstitialMetricsHelper::PROCEED); | 250 SecurityInterstitialMetricsHelper::PROCEED); |
| 270 interstitial_page()->Proceed(); | 251 interstitial_page()->Proceed(); |
| 271 // |this| has been deleted after Proceed() returns. | 252 // |this| has been deleted after Proceed() returns. |
| 272 break; | 253 break; |
| 273 } | 254 } |
| 274 // If the user can't proceed, fall through to CMD_DONT_PROCEED. | 255 // If the user can't proceed, fall through to CMD_DONT_PROCEED. |
| 275 } | 256 } |
| 276 case CMD_DONT_PROCEED: { | 257 case CMD_DONT_PROCEED: { |
| 277 // User pressed on the button to return to safety. | 258 // User pressed on the button to return to safety. |
| 278 // Don't record the user action here because there are other ways of | 259 // Don't record the user action here because there are other ways of |
| (...skipping 18 matching lines...) Expand all Loading... |
| 297 std::string()); | 278 std::string()); |
| 298 } | 279 } |
| 299 break; | 280 break; |
| 300 } | 281 } |
| 301 case CMD_OPEN_DIAGNOSTIC: { | 282 case CMD_OPEN_DIAGNOSTIC: { |
| 302 // User wants to see why this page is blocked. | 283 // User wants to see why this page is blocked. |
| 303 // TODO(felt): element_index will always be 0. See crbug.com/464732 | 284 // TODO(felt): element_index will always be 0. See crbug.com/464732 |
| 304 size_t element_index = 0; | 285 size_t element_index = 0; |
| 305 const UnsafeResource& unsafe_resource = unsafe_resources_[element_index]; | 286 const UnsafeResource& unsafe_resource = unsafe_resources_[element_index]; |
| 306 std::string bad_url_spec = unsafe_resource.url.spec(); | 287 std::string bad_url_spec = unsafe_resource.url.spec(); |
| 307 metrics_helper_->RecordUserInteraction( | 288 metrics_helper()->RecordUserInteraction( |
| 308 SecurityInterstitialMetricsHelper::SHOW_DIAGNOSTIC); | 289 SecurityInterstitialMetricsHelper::SHOW_DIAGNOSTIC); |
| 309 std::string diagnostic = | 290 std::string diagnostic = |
| 310 base::StringPrintf(kSbDiagnosticUrl, | 291 base::StringPrintf(kSbDiagnosticUrl, |
| 311 net::EscapeQueryParamValue(bad_url_spec, true).c_str()); | 292 net::EscapeQueryParamValue(bad_url_spec, true).c_str()); |
| 312 GURL diagnostic_url(diagnostic); | 293 GURL diagnostic_url(diagnostic); |
| 313 diagnostic_url = google_util::AppendGoogleLocaleParam( | 294 diagnostic_url = google_util::AppendGoogleLocaleParam( |
| 314 diagnostic_url, g_browser_process->GetApplicationLocale()); | 295 diagnostic_url, g_browser_process->GetApplicationLocale()); |
| 315 DCHECK(unsafe_resource.threat_type == SB_THREAT_TYPE_URL_MALWARE || | 296 DCHECK(unsafe_resource.threat_type == SB_THREAT_TYPE_URL_MALWARE || |
| 316 unsafe_resource.threat_type == | 297 unsafe_resource.threat_type == |
| 317 SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL || | 298 SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL || |
| 318 unsafe_resource.threat_type == SB_THREAT_TYPE_URL_UNWANTED); | 299 unsafe_resource.threat_type == SB_THREAT_TYPE_URL_UNWANTED); |
| 319 OpenURLParams params( | 300 OpenURLParams params( |
| 320 diagnostic_url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_LINK, | 301 diagnostic_url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_LINK, |
| 321 false); | 302 false); |
| 322 web_contents()->OpenURL(params); | 303 web_contents()->OpenURL(params); |
| 323 break; | 304 break; |
| 324 } | 305 } |
| 325 case CMD_SHOW_MORE_SECTION: { | 306 case CMD_SHOW_MORE_SECTION: { |
| 326 // User has opened up the hidden text. | 307 // User has opened up the hidden text. |
| 327 metrics_helper_->RecordUserInteraction( | 308 metrics_helper()->RecordUserInteraction( |
| 328 SecurityInterstitialMetricsHelper::SHOW_ADVANCED); | 309 SecurityInterstitialMetricsHelper::SHOW_ADVANCED); |
| 329 break; | 310 break; |
| 330 } | 311 } |
| 331 } | 312 } |
| 332 } | 313 } |
| 333 | 314 |
| 334 void SafeBrowsingBlockingPage::OverrideRendererPrefs( | 315 void SafeBrowsingBlockingPage::OverrideRendererPrefs( |
| 335 content::RendererPreferences* prefs) { | 316 content::RendererPreferences* prefs) { |
| 336 Profile* profile = Profile::FromBrowserContext( | 317 Profile* profile = Profile::FromBrowserContext( |
| 337 web_contents()->GetBrowserContext()); | 318 web_contents()->GetBrowserContext()); |
| 338 renderer_preferences_util::UpdateFromSystemSettings( | 319 renderer_preferences_util::UpdateFromSystemSettings( |
| 339 prefs, profile, web_contents()); | 320 prefs, profile, web_contents()); |
| 340 } | 321 } |
| 341 | 322 |
| 342 void SafeBrowsingBlockingPage::SetReportingPreference(bool report) { | |
| 343 Profile* profile = Profile::FromBrowserContext( | |
| 344 web_contents()->GetBrowserContext()); | |
| 345 PrefService* pref = profile->GetPrefs(); | |
| 346 pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report); | |
| 347 UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report); | |
| 348 } | |
| 349 | |
| 350 void SafeBrowsingBlockingPage::OnProceed() { | 323 void SafeBrowsingBlockingPage::OnProceed() { |
| 351 proceeded_ = true; | 324 proceeded_ = true; |
| 352 // Send the malware details, if we opted to. | 325 // Send the malware details, if we opted to. |
| 353 FinishMalwareDetails(malware_details_proceed_delay_ms_); | 326 FinishMalwareDetails(malware_details_proceed_delay_ms_); |
| 354 | 327 |
| 355 NotifySafeBrowsingUIManager(ui_manager_, unsafe_resources_, true); | 328 NotifySafeBrowsingUIManager(ui_manager_, unsafe_resources_, true); |
| 356 | 329 |
| 357 // Check to see if some new notifications of unsafe resources have been | 330 // Check to see if some new notifications of unsafe resources have been |
| 358 // received while we were showing the interstitial. | 331 // received while we were showing the interstitial. |
| 359 UnsafeResourceMap* unsafe_resource_map = GetUnsafeResourcesMap(); | 332 UnsafeResourceMap* unsafe_resource_map = GetUnsafeResourcesMap(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 383 return is_main_frame_load_blocked_; | 356 return is_main_frame_load_blocked_; |
| 384 } | 357 } |
| 385 | 358 |
| 386 void SafeBrowsingBlockingPage::OnDontProceed() { | 359 void SafeBrowsingBlockingPage::OnDontProceed() { |
| 387 // We could have already called Proceed(), in which case we must not notify | 360 // We could have already called Proceed(), in which case we must not notify |
| 388 // the SafeBrowsingUIManager again, as the client has been deleted. | 361 // the SafeBrowsingUIManager again, as the client has been deleted. |
| 389 if (proceeded_) | 362 if (proceeded_) |
| 390 return; | 363 return; |
| 391 | 364 |
| 392 if (!IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { | 365 if (!IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { |
| 393 metrics_helper_->RecordUserDecision( | 366 metrics_helper()->RecordUserDecision( |
| 394 SecurityInterstitialMetricsHelper::DONT_PROCEED); | 367 SecurityInterstitialMetricsHelper::DONT_PROCEED); |
| 395 } | 368 } |
| 396 | 369 |
| 397 // Send the malware details, if we opted to. | 370 // Send the malware details, if we opted to. |
| 398 FinishMalwareDetails(0); // No delay | 371 FinishMalwareDetails(0); // No delay |
| 399 | 372 |
| 400 NotifySafeBrowsingUIManager(ui_manager_, unsafe_resources_, false); | 373 NotifySafeBrowsingUIManager(ui_manager_, unsafe_resources_, false); |
| 401 | 374 |
| 402 // The user does not want to proceed, clear the queued unsafe resources | 375 // The user does not want to proceed, clear the queued unsafe resources |
| 403 // notifications we received while the interstitial was showing. | 376 // notifications we received while the interstitial was showing. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 424 } | 397 } |
| 425 } | 398 } |
| 426 | 399 |
| 427 void SafeBrowsingBlockingPage::FinishMalwareDetails(int64 delay_ms) { | 400 void SafeBrowsingBlockingPage::FinishMalwareDetails(int64 delay_ms) { |
| 428 if (malware_details_.get() == NULL) | 401 if (malware_details_.get() == NULL) |
| 429 return; // Not all interstitials have malware details (eg phishing). | 402 return; // Not all interstitials have malware details (eg phishing). |
| 430 DCHECK_EQ(interstitial_reason_, SB_REASON_MALWARE); | 403 DCHECK_EQ(interstitial_reason_, SB_REASON_MALWARE); |
| 431 | 404 |
| 432 const bool enabled = | 405 const bool enabled = |
| 433 IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled); | 406 IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled); |
| 434 UMA_HISTOGRAM_BOOLEAN("SB2.ExtendedReportingIsEnabled", enabled); | 407 if (!enabled) |
| 435 if (enabled) { | 408 return; |
| 436 // Finish the malware details collection, send it over. | |
| 437 BrowserThread::PostDelayedTask( | |
| 438 BrowserThread::IO, FROM_HERE, | |
| 439 base::Bind(&MalwareDetails::FinishCollection, malware_details_.get()), | |
| 440 base::TimeDelta::FromMilliseconds(delay_ms)); | |
| 441 } | |
| 442 } | |
| 443 | 409 |
| 444 bool SafeBrowsingBlockingPage::IsPrefEnabled(const char* pref) { | 410 metrics_helper()->RecordUserInteraction( |
| 445 Profile* profile = | 411 SecurityInterstitialMetricsHelper::EXTENDED_REPORTING_IS_ENABLED); |
| 446 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 412 // Finish the malware details collection, send it over. |
| 447 return profile->GetPrefs()->GetBoolean(pref); | 413 BrowserThread::PostDelayedTask( |
| 414 BrowserThread::IO, FROM_HERE, |
| 415 base::Bind(&MalwareDetails::FinishCollection, malware_details_.get()), |
| 416 base::TimeDelta::FromMilliseconds(delay_ms)); |
| 448 } | 417 } |
| 449 | 418 |
| 450 // static | 419 // static |
| 451 void SafeBrowsingBlockingPage::NotifySafeBrowsingUIManager( | 420 void SafeBrowsingBlockingPage::NotifySafeBrowsingUIManager( |
| 452 SafeBrowsingUIManager* ui_manager, | 421 SafeBrowsingUIManager* ui_manager, |
| 453 const UnsafeResourceList& unsafe_resources, | 422 const UnsafeResourceList& unsafe_resources, |
| 454 bool proceed) { | 423 bool proceed) { |
| 455 BrowserThread::PostTask( | 424 BrowserThread::PostTask( |
| 456 BrowserThread::IO, FROM_HERE, | 425 BrowserThread::IO, FROM_HERE, |
| 457 base::Bind(&SafeBrowsingUIManager::OnBlockingPageDone, | 426 base::Bind(&SafeBrowsingUIManager::OnBlockingPageDone, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 case SB_REASON_PHISHING: | 550 case SB_REASON_PHISHING: |
| 582 PopulatePhishingLoadTimeData(load_time_data); | 551 PopulatePhishingLoadTimeData(load_time_data); |
| 583 break; | 552 break; |
| 584 } | 553 } |
| 585 } | 554 } |
| 586 | 555 |
| 587 void SafeBrowsingBlockingPage::PopulateExtendedReportingOption( | 556 void SafeBrowsingBlockingPage::PopulateExtendedReportingOption( |
| 588 base::DictionaryValue* load_time_data) { | 557 base::DictionaryValue* load_time_data) { |
| 589 // Only show checkbox if !(HTTPS || incognito-mode). | 558 // Only show checkbox if !(HTTPS || incognito-mode). |
| 590 const bool show = CanShowMalwareDetailsOption(); | 559 const bool show = CanShowMalwareDetailsOption(); |
| 591 load_time_data->SetBoolean(kDisplayCheckBox, show); | 560 load_time_data->SetBoolean(interstitials::kDisplayCheckBox, show); |
| 592 if (!show) | 561 if (!show) |
| 593 return; | 562 return; |
| 594 | 563 |
| 595 const std::string privacy_link = base::StringPrintf( | 564 const std::string privacy_link = base::StringPrintf( |
| 596 kPrivacyLinkHtml, | 565 interstitials::kPrivacyLinkHtml, CMD_OPEN_REPORTING_PRIVACY, |
| 597 CMD_OPEN_REPORTING_PRIVACY, | 566 l10n_util::GetStringUTF8(IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE).c_str()); |
| 598 l10n_util::GetStringUTF8( | |
| 599 IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE).c_str()); | |
| 600 load_time_data->SetString( | 567 load_time_data->SetString( |
| 601 "optInLink", | 568 interstitials::kOptInLink, |
| 602 l10n_util::GetStringFUTF16(IDS_SAFE_BROWSING_MALWARE_REPORTING_AGREE, | 569 l10n_util::GetStringFUTF16(IDS_SAFE_BROWSING_MALWARE_REPORTING_AGREE, |
| 603 base::UTF8ToUTF16(privacy_link))); | 570 base::UTF8ToUTF16(privacy_link))); |
| 604 load_time_data->SetBoolean( | 571 load_time_data->SetBoolean( |
| 605 kBoxChecked, | 572 interstitials::kBoxChecked, |
| 606 IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled)); | 573 IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled)); |
| 607 } | 574 } |
| 608 | 575 |
| 609 void SafeBrowsingBlockingPage::PopulateMalwareLoadTimeData( | 576 void SafeBrowsingBlockingPage::PopulateMalwareLoadTimeData( |
| 610 base::DictionaryValue* load_time_data) { | 577 base::DictionaryValue* load_time_data) { |
| 611 load_time_data->SetBoolean("phishing", false); | 578 load_time_data->SetBoolean("phishing", false); |
| 612 load_time_data->SetString( | 579 load_time_data->SetString( |
| 613 "heading", l10n_util::GetStringUTF16(IDS_MALWARE_V3_HEADING)); | 580 "heading", l10n_util::GetStringUTF16(IDS_MALWARE_V3_HEADING)); |
| 614 load_time_data->SetString( | 581 load_time_data->SetString( |
| 615 "primaryParagraph", | 582 "primaryParagraph", |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 load_time_data->SetString( | 636 load_time_data->SetString( |
| 670 "explanationParagraph", | 637 "explanationParagraph", |
| 671 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, | 638 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, |
| 672 GetFormattedHostName())); | 639 GetFormattedHostName())); |
| 673 load_time_data->SetString( | 640 load_time_data->SetString( |
| 674 "finalParagraph", | 641 "finalParagraph", |
| 675 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); | 642 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); |
| 676 | 643 |
| 677 PopulateExtendedReportingOption(load_time_data); | 644 PopulateExtendedReportingOption(load_time_data); |
| 678 } | 645 } |
| OLD | NEW |