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

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

Issue 2874873002: [Payments] Record use stats after payment request completion. (Closed)
Patch Set: Removed billing address log 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/payments/content/payment_request_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return; 161 return;
162 162
163 if (result != mojom::PaymentComplete::SUCCESS) { 163 if (result != mojom::PaymentComplete::SUCCESS) {
164 delegate_->ShowErrorMessage(); 164 delegate_->ShowErrorMessage();
165 } else { 165 } else {
166 journey_logger_.RecordJourneyStatsHistograms( 166 journey_logger_.RecordJourneyStatsHistograms(
167 JourneyLogger::COMPLETION_STATUS_COMPLETED); 167 JourneyLogger::COMPLETION_STATUS_COMPLETED);
168 // When the renderer closes the connection, 168 // When the renderer closes the connection,
169 // PaymentRequest::OnConnectionTerminated will be called. 169 // PaymentRequest::OnConnectionTerminated will be called.
170 client_->OnComplete(); 170 client_->OnComplete();
171 state_->RecordUseStats();
171 } 172 }
172 } 173 }
173 174
174 void PaymentRequest::CanMakePayment() { 175 void PaymentRequest::CanMakePayment() {
175 bool can_make_payment = state()->CanMakePayment(); 176 bool can_make_payment = state()->CanMakePayment();
176 if (delegate_->IsIncognito()) { 177 if (delegate_->IsIncognito()) {
177 client_->OnCanMakePayment( 178 client_->OnCanMakePayment(
178 mojom::CanMakePaymentQueryResult::CAN_MAKE_PAYMENT); 179 mojom::CanMakePaymentQueryResult::CAN_MAKE_PAYMENT);
179 journey_logger_.SetCanMakePaymentValue(true); 180 journey_logger_.SetCanMakePaymentValue(true);
180 } else if (CanMakePaymentQueryFactory::GetInstance() 181 } else if (CanMakePaymentQueryFactory::GetInstance()
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if (observer_for_testing_) 248 if (observer_for_testing_)
248 observer_for_testing_->OnConnectionTerminated(); 249 observer_for_testing_->OnConnectionTerminated();
249 manager_->DestroyRequest(this); 250 manager_->DestroyRequest(this);
250 } 251 }
251 252
252 void PaymentRequest::Pay() { 253 void PaymentRequest::Pay() {
253 state_->GeneratePaymentResponse(); 254 state_->GeneratePaymentResponse();
254 } 255 }
255 256
256 } // namespace payments 257 } // namespace payments
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/payments/content/payment_request_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698