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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_dialog_view.cc

Issue 2807363003: [Payments] After adding/editing a credit card, instrument is selected. (Closed)
Patch Set: include fix Created 3 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 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 "chrome/browser/ui/views/payments/payment_request_dialog_view.h" 5 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 base::MakeUnique<CvcUnmaskViewController>( 208 base::MakeUnique<CvcUnmaskViewController>(
209 request_->spec(), request_->state(), this, 209 request_->spec(), request_->state(), this,
210 credit_card, result_delegate, web_contents), 210 credit_card, result_delegate, web_contents),
211 &controller_map_), 211 &controller_map_),
212 /* animate = */ true); 212 /* animate = */ true);
213 if (observer_for_testing_) 213 if (observer_for_testing_)
214 observer_for_testing_->OnCvcPromptShown(); 214 observer_for_testing_->OnCvcPromptShown();
215 } 215 }
216 216
217 void PaymentRequestDialogView::ShowCreditCardEditor( 217 void PaymentRequestDialogView::ShowCreditCardEditor(
218 base::OnceClosure on_edited,
219 base::OnceCallback<void(const autofill::CreditCard&)> on_added,
218 autofill::CreditCard* credit_card) { 220 autofill::CreditCard* credit_card) {
219 view_stack_.Push( 221 view_stack_.Push(
220 CreateViewAndInstallController( 222 CreateViewAndInstallController(
221 base::MakeUnique<CreditCardEditorViewController>( 223 base::MakeUnique<CreditCardEditorViewController>(
222 request_->spec(), request_->state(), this, credit_card), 224 request_->spec(), request_->state(), this, std::move(on_edited),
225 std::move(on_added), credit_card),
223 &controller_map_), 226 &controller_map_),
224 /* animate = */ true); 227 /* animate = */ true);
225 if (observer_for_testing_) 228 if (observer_for_testing_)
226 observer_for_testing_->OnCreditCardEditorOpened(); 229 observer_for_testing_->OnCreditCardEditorOpened();
227 } 230 }
228 231
229 void PaymentRequestDialogView::ShowShippingAddressEditor( 232 void PaymentRequestDialogView::ShowShippingAddressEditor(
230 autofill::AutofillProfile* profile) { 233 autofill::AutofillProfile* profile) {
231 view_stack_.Push(CreateViewAndInstallController( 234 view_stack_.Push(CreateViewAndInstallController(
232 base::MakeUnique<ShippingAddressEditorViewController>( 235 base::MakeUnique<ShippingAddressEditorViewController>(
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // When a view that is associated with a controller is removed from this 310 // When a view that is associated with a controller is removed from this
308 // view's descendants, dispose of the controller. 311 // view's descendants, dispose of the controller.
309 if (!details.is_add && 312 if (!details.is_add &&
310 controller_map_.find(details.child) != controller_map_.end()) { 313 controller_map_.find(details.child) != controller_map_.end()) {
311 DCHECK(!details.move_view); 314 DCHECK(!details.move_view);
312 controller_map_.erase(details.child); 315 controller_map_.erase(details.child);
313 } 316 }
314 } 317 }
315 318
316 } // namespace payments 319 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698