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

Side by Side Diff: components/payments/content/payment_request.cc

Issue 2899313002: [Payments] Move the logging for checkout flow to native. (Closed)
Patch Set: Addressed comments Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "components/payments/content/payment_request.h" 5 #include "components/payments/content/payment_request.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 observer_for_testing_->OnAbortCalled(); 167 observer_for_testing_->OnAbortCalled();
168 } 168 }
169 169
170 void PaymentRequest::Complete(mojom::PaymentComplete result) { 170 void PaymentRequest::Complete(mojom::PaymentComplete result) {
171 if (!client_.is_bound()) 171 if (!client_.is_bound())
172 return; 172 return;
173 173
174 if (result != mojom::PaymentComplete::SUCCESS) { 174 if (result != mojom::PaymentComplete::SUCCESS) {
175 delegate_->ShowErrorMessage(); 175 delegate_->ShowErrorMessage();
176 } else { 176 } else {
177 journey_logger_.RecordJourneyStatsHistograms( 177 journey_logger_.SetCompleted();
178 JourneyLogger::COMPLETION_STATUS_COMPLETED);
179 delegate_->GetPrefService()->SetBoolean(kPaymentsFirstTransactionCompleted, 178 delegate_->GetPrefService()->SetBoolean(kPaymentsFirstTransactionCompleted,
180 true); 179 true);
181 // When the renderer closes the connection, 180 // When the renderer closes the connection,
182 // PaymentRequest::OnConnectionTerminated will be called. 181 // PaymentRequest::OnConnectionTerminated will be called.
183 client_->OnComplete(); 182 client_->OnComplete();
184 state_->RecordUseStats(); 183 state_->RecordUseStats();
185 } 184 }
186 } 185 }
187 186
188 void PaymentRequest::CanMakePayment() { 187 void PaymentRequest::CanMakePayment() {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 268 }
270 269
271 void PaymentRequest::Pay() { 270 void PaymentRequest::Pay() {
272 state_->GeneratePaymentResponse(); 271 state_->GeneratePaymentResponse();
273 } 272 }
274 273
275 void PaymentRequest::RecordFirstCompletionStatus( 274 void PaymentRequest::RecordFirstCompletionStatus(
276 JourneyLogger::CompletionStatus completion_status) { 275 JourneyLogger::CompletionStatus completion_status) {
277 if (!has_recorded_abort_reason_) { 276 if (!has_recorded_abort_reason_) {
278 has_recorded_abort_reason_ = true; 277 has_recorded_abort_reason_ = true;
279 journey_logger_.RecordJourneyStatsHistograms(completion_status); 278 // TODO(crbug.com/716546): Record more abort reasons.
279 if (completion_status == JourneyLogger::COMPLETION_STATUS_USER_ABORTED) {
280 journey_logger_.SetAborted(JourneyLogger::ABORT_REASON_ABORTED_BY_USER);
281 } else {
282 journey_logger_.SetAborted(JourneyLogger::ABORT_REASON_OTHER);
283 }
280 } 284 }
281 } 285 }
282 286
283 } // namespace payments 287 } // namespace payments
OLDNEW
« no previous file with comments | « chrome/browser/payments/android/journey_logger_android.cc ('k') | components/payments/core/journey_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698