| 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report); | 474 UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report); |
| 475 reporting_checkbox_checked_ = report; | 475 reporting_checkbox_checked_ = report; |
| 476 pref->ClearPref(prefs::kSafeBrowsingReportingEnabled); | 476 pref->ClearPref(prefs::kSafeBrowsingReportingEnabled); |
| 477 pref->ClearPref(prefs::kSafeBrowsingDownloadFeedbackEnabled); | 477 pref->ClearPref(prefs::kSafeBrowsingDownloadFeedbackEnabled); |
| 478 } | 478 } |
| 479 | 479 |
| 480 // If the reporting checkbox was left checked on close, the new pref | 480 // If the reporting checkbox was left checked on close, the new pref |
| 481 // kSafeBrowsingExtendedReportingEnabled should be updated. | 481 // kSafeBrowsingExtendedReportingEnabled should be updated. |
| 482 // TODO(felt): Remove this in M-39. crbug.com/384668 | 482 // TODO(felt): Remove this in M-39. crbug.com/384668 |
| 483 void SafeBrowsingBlockingPage::UpdateReportingPref() { | 483 void SafeBrowsingBlockingPage::UpdateReportingPref() { |
| 484 LOG(ERROR) << "1"; | |
| 485 if (!reporting_checkbox_checked_) | 484 if (!reporting_checkbox_checked_) |
| 486 return; | 485 return; |
| 487 LOG(ERROR) << "2"; | |
| 488 if (IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled)) | 486 if (IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled)) |
| 489 return; | 487 return; |
| 490 LOG(ERROR) << "3"; | |
| 491 Profile* profile = Profile::FromBrowserContext( | 488 Profile* profile = Profile::FromBrowserContext( |
| 492 web_contents_->GetBrowserContext()); | 489 web_contents_->GetBrowserContext()); |
| 493 if (profile->GetPrefs()->HasPrefPath( | 490 if (profile->GetPrefs()->HasPrefPath( |
| 494 prefs::kSafeBrowsingExtendedReportingEnabled)) | 491 prefs::kSafeBrowsingExtendedReportingEnabled)) |
| 495 return; | 492 return; |
| 496 LOG(ERROR) << "4"; | |
| 497 SetReportingPreference(true); | 493 SetReportingPreference(true); |
| 498 LOG(ERROR) << "5"; | |
| 499 } | 494 } |
| 500 | 495 |
| 501 void SafeBrowsingBlockingPage::OnProceed() { | 496 void SafeBrowsingBlockingPage::OnProceed() { |
| 502 proceeded_ = true; | 497 proceeded_ = true; |
| 503 RecordUserAction(PROCEED); | 498 RecordUserAction(PROCEED); |
| 504 UpdateReportingPref(); | 499 UpdateReportingPref(); |
| 505 // Send the malware details, if we opted to. | 500 // Send the malware details, if we opted to. |
| 506 FinishMalwareDetails(malware_details_proceed_delay_ms_); | 501 FinishMalwareDetails(malware_details_proceed_delay_ms_); |
| 507 | 502 |
| 508 NotifySafeBrowsingUIManager(ui_manager_, unsafe_resources_, true); | 503 NotifySafeBrowsingUIManager(ui_manager_, unsafe_resources_, true); |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, | 1336 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, |
| 1342 base::UTF8ToUTF16(url_.host()))); | 1337 base::UTF8ToUTF16(url_.host()))); |
| 1343 load_time_data->SetString( | 1338 load_time_data->SetString( |
| 1344 "explanationParagraph", | 1339 "explanationParagraph", |
| 1345 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, | 1340 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, |
| 1346 base::UTF8ToUTF16(url_.host()))); | 1341 base::UTF8ToUTF16(url_.host()))); |
| 1347 load_time_data->SetString( | 1342 load_time_data->SetString( |
| 1348 "finalParagraph", | 1343 "finalParagraph", |
| 1349 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); | 1344 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); |
| 1350 } | 1345 } |
| OLD | NEW |