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

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

Issue 2841643002: When a new Payments address is created from the editor, use it as the chosen address (Closed)
Patch Set: And yet another small goof 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 base::MakeUnique<CreditCardEditorViewController>( 239 base::MakeUnique<CreditCardEditorViewController>(
240 request_->spec(), request_->state(), this, std::move(on_edited), 240 request_->spec(), request_->state(), this, std::move(on_edited),
241 std::move(on_added), credit_card), 241 std::move(on_added), credit_card),
242 &controller_map_), 242 &controller_map_),
243 /* animate = */ true); 243 /* animate = */ true);
244 if (observer_for_testing_) 244 if (observer_for_testing_)
245 observer_for_testing_->OnCreditCardEditorOpened(); 245 observer_for_testing_->OnCreditCardEditorOpened();
246 } 246 }
247 247
248 void PaymentRequestDialogView::ShowShippingAddressEditor( 248 void PaymentRequestDialogView::ShowShippingAddressEditor(
249 base::OnceClosure on_edited,
250 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added,
249 autofill::AutofillProfile* profile) { 251 autofill::AutofillProfile* profile) {
250 view_stack_->Push(CreateViewAndInstallController( 252 view_stack_->Push(CreateViewAndInstallController(
251 base::MakeUnique<ShippingAddressEditorViewController>( 253 base::MakeUnique<ShippingAddressEditorViewController>(
252 request_->spec(), request_->state(), this, profile), 254 request_->spec(), request_->state(), this,
255 std::move(on_edited), std::move(on_added), profile),
253 &controller_map_), 256 &controller_map_),
254 /* animate = */ true); 257 /* animate = */ true);
255 if (observer_for_testing_) 258 if (observer_for_testing_)
256 observer_for_testing_->OnShippingAddressEditorOpened(); 259 observer_for_testing_->OnShippingAddressEditorOpened();
257 } 260 }
258 261
259 void PaymentRequestDialogView::ShowContactInfoEditor( 262 void PaymentRequestDialogView::ShowContactInfoEditor(
260 autofill::AutofillProfile* profile) { 263 autofill::AutofillProfile* profile) {
261 view_stack_->Push(CreateViewAndInstallController( 264 view_stack_->Push(CreateViewAndInstallController(
262 base::MakeUnique<ContactInfoEditorViewController>( 265 base::MakeUnique<ContactInfoEditorViewController>(
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // When a view that is associated with a controller is removed from this 340 // When a view that is associated with a controller is removed from this
338 // view's descendants, dispose of the controller. 341 // view's descendants, dispose of the controller.
339 if (!details.is_add && 342 if (!details.is_add &&
340 controller_map_.find(details.child) != controller_map_.end()) { 343 controller_map_.find(details.child) != controller_map_.end()) {
341 DCHECK(!details.move_view); 344 DCHECK(!details.move_view);
342 controller_map_.erase(details.child); 345 controller_map_.erase(details.child);
343 } 346 }
344 } 347 }
345 348
346 } // namespace payments 349 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698