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

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

Issue 2870153002: [Payments] Record navigations that close the Payment Request as aborts. (Closed)
Patch Set: 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 // This sends an error to the renderer, which informs the API user. 187 // This sends an error to the renderer, which informs the API user.
188 client_->OnError(mojom::PaymentErrorReason::USER_CANCEL); 188 client_->OnError(mojom::PaymentErrorReason::USER_CANCEL);
189 189
190 // We close all bindings and ask to be destroyed. 190 // We close all bindings and ask to be destroyed.
191 client_.reset(); 191 client_.reset();
192 binding_.Close(); 192 binding_.Close();
193 manager_->DestroyRequest(this); 193 manager_->DestroyRequest(this);
194 } 194 }
195 195
196 void PaymentRequest::NavigatedAway(bool is_user_initiated) {
197 journey_logger_.RecordJourneyStatsHistograms(
198 is_user_initiated ? JourneyLogger::COMPLETION_STATUS_USER_ABORTED
199 : JourneyLogger::COMPLETION_STATUS_OTHER_ABORTED);
200 }
201
196 void PaymentRequest::OnConnectionTerminated() { 202 void PaymentRequest::OnConnectionTerminated() {
197 // We are here because of a browser-side error, or likely as a result of the 203 // We are here because of a browser-side error, or likely as a result of the
198 // connection_error_handler on |binding_|, which can mean that the renderer 204 // connection_error_handler on |binding_|, which can mean that the renderer
199 // has decided to close the pipe for various reasons (see all uses of 205 // has decided to close the pipe for various reasons (see all uses of
200 // PaymentRequest::clearResolversAndCloseMojoConnection() in Blink). We close 206 // PaymentRequest::clearResolversAndCloseMojoConnection() in Blink). We close
201 // the binding and the dialog, and ask to be deleted. 207 // the binding and the dialog, and ask to be deleted.
208 journey_logger_.RecordJourneyStatsHistograms(
209 JourneyLogger::COMPLETION_STATUS_OTHER_ABORTED);
Mathieu 2017/05/09 18:12:19 I don't think this line should be here, because it
sebsg 2017/05/10 14:58:48 I still feel like we should log something here. Wo
202 client_.reset(); 210 client_.reset();
203 binding_.Close(); 211 binding_.Close();
204 delegate_->CloseDialog(); 212 delegate_->CloseDialog();
205 manager_->DestroyRequest(this); 213 manager_->DestroyRequest(this);
206 } 214 }
207 215
208 void PaymentRequest::Pay() { 216 void PaymentRequest::Pay() {
209 state_->GeneratePaymentResponse(); 217 state_->GeneratePaymentResponse();
210 } 218 }
211 219
212 } // namespace payments 220 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698