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

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

Issue 1870003002: Convert //chrome/browser/safe_browsing from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments Created 4 years, 8 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
OLDNEW
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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
14 #include "base/lazy_instance.h" 14 #include "base/lazy_instance.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ptr_util.h"
16 #include "base/metrics/field_trial.h" 17 #include "base/metrics/field_trial.h"
17 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
18 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
19 #include "base/strings/string_piece.h" 20 #include "base/strings/string_piece.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
21 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
22 #include "base/time/time.h" 23 #include "base/time/time.h"
23 #include "base/values.h" 24 #include "base/values.h"
24 #include "chrome/browser/browser_process.h" 25 #include "chrome/browser/browser_process.h"
25 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 interstitial_reason_ = SB_REASON_HARMFUL; 173 interstitial_reason_ = SB_REASON_HARMFUL;
173 else 174 else
174 interstitial_reason_ = SB_REASON_PHISHING; 175 interstitial_reason_ = SB_REASON_PHISHING;
175 176
176 // This must be done after calculating |interstitial_reason_| above. 177 // This must be done after calculating |interstitial_reason_| above.
177 security_interstitials::MetricsHelper::ReportDetails reporting_info; 178 security_interstitials::MetricsHelper::ReportDetails reporting_info;
178 reporting_info.metric_prefix = GetMetricPrefix(); 179 reporting_info.metric_prefix = GetMetricPrefix();
179 reporting_info.extra_suffix = GetExtraMetricsSuffix(); 180 reporting_info.extra_suffix = GetExtraMetricsSuffix();
180 reporting_info.rappor_prefix = GetRapporPrefix(); 181 reporting_info.rappor_prefix = GetRapporPrefix();
181 reporting_info.rappor_report_type = rappor::SAFEBROWSING_RAPPOR_TYPE; 182 reporting_info.rappor_report_type = rappor::SAFEBROWSING_RAPPOR_TYPE;
182 set_metrics_helper(make_scoped_ptr(new ChromeMetricsHelper( 183 set_metrics_helper(base::WrapUnique(new ChromeMetricsHelper(
183 web_contents, request_url(), reporting_info, GetSamplingEventName()))); 184 web_contents, request_url(), reporting_info, GetSamplingEventName())));
184 metrics_helper()->RecordUserDecision( 185 metrics_helper()->RecordUserDecision(
185 security_interstitials::MetricsHelper::SHOW); 186 security_interstitials::MetricsHelper::SHOW);
186 metrics_helper()->RecordUserInteraction( 187 metrics_helper()->RecordUserInteraction(
187 security_interstitials::MetricsHelper::TOTAL_VISITS); 188 security_interstitials::MetricsHelper::TOTAL_VISITS);
188 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { 189 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) {
189 metrics_helper()->RecordUserDecision( 190 metrics_helper()->RecordUserDecision(
190 security_interstitials::MetricsHelper::PROCEEDING_DISABLED); 191 security_interstitials::MetricsHelper::PROCEEDING_DISABLED);
191 } 192 }
192 193
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 } else { 724 } else {
724 load_time_data->SetString( 725 load_time_data->SetString(
725 "finalParagraph", 726 "finalParagraph",
726 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); 727 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH));
727 } 728 }
728 729
729 PopulateExtendedReportingOption(load_time_data); 730 PopulateExtendedReportingOption(load_time_data);
730 } 731 }
731 732
732 } // namespace safe_browsing 733 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698