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

Side by Side Diff: ios/chrome/browser/safe_browsing/safe_browsing_blocking_page.mm

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/safe_browsing/safe_browsing_blocking_page.h" 7 #include "ios/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 "components/google/core/browser/google_util.h" 25 #include "components/google/core/browser/google_util.h"
25 #include "components/prefs/pref_service.h" 26 #include "components/prefs/pref_service.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 interstitial_reason_ = SB_REASON_HARMFUL; 145 interstitial_reason_ = SB_REASON_HARMFUL;
145 else 146 else
146 interstitial_reason_ = SB_REASON_PHISHING; 147 interstitial_reason_ = SB_REASON_PHISHING;
147 148
148 // This must be done after calculating |interstitial_reason_| above. 149 // This must be done after calculating |interstitial_reason_| above.
149 security_interstitials::MetricsHelper::ReportDetails reporting_info; 150 security_interstitials::MetricsHelper::ReportDetails reporting_info;
150 reporting_info.metric_prefix = GetMetricPrefix(); 151 reporting_info.metric_prefix = GetMetricPrefix();
151 reporting_info.extra_suffix = GetExtraMetricsSuffix(); 152 reporting_info.extra_suffix = GetExtraMetricsSuffix();
152 reporting_info.rappor_prefix = GetRapporPrefix(); 153 reporting_info.rappor_prefix = GetRapporPrefix();
153 reporting_info.rappor_report_type = rappor::SAFEBROWSING_RAPPOR_TYPE; 154 reporting_info.rappor_report_type = rappor::SAFEBROWSING_RAPPOR_TYPE;
154 controller_->set_metrics_helper(make_scoped_ptr( 155 controller_->set_metrics_helper(base::WrapUnique(
155 new IOSChromeMetricsHelper(web_state, request_url(), reporting_info))); 156 new IOSChromeMetricsHelper(web_state, request_url(), reporting_info)));
156 controller_->metrics_helper()->RecordUserDecision( 157 controller_->metrics_helper()->RecordUserDecision(
157 security_interstitials::MetricsHelper::SHOW); 158 security_interstitials::MetricsHelper::SHOW);
158 controller_->metrics_helper()->RecordUserInteraction( 159 controller_->metrics_helper()->RecordUserInteraction(
159 security_interstitials::MetricsHelper::TOTAL_VISITS); 160 security_interstitials::MetricsHelper::TOTAL_VISITS);
160 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { 161 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) {
161 controller_->metrics_helper()->RecordUserDecision( 162 controller_->metrics_helper()->RecordUserDecision(
162 security_interstitials::MetricsHelper::PROCEEDING_DISABLED); 163 security_interstitials::MetricsHelper::PROCEEDING_DISABLED);
163 } 164 }
164 165
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } else { 590 } else {
590 load_time_data->SetString( 591 load_time_data->SetString(
591 "finalParagraph", 592 "finalParagraph",
592 l10n_util::GetStringUTF16(IDS_IOS_PHISHING_V3_PROCEED_PARAGRAPH)); 593 l10n_util::GetStringUTF16(IDS_IOS_PHISHING_V3_PROCEED_PARAGRAPH));
593 } 594 }
594 595
595 load_time_data->SetBoolean(security_interstitials::kDisplayCheckBox, false); 596 load_time_data->SetBoolean(security_interstitials::kDisplayCheckBox, false);
596 } 597 }
597 598
598 } // namespace safe_browsing 599 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698