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

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: Self CR 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 base::MakeUnique<CreditCardEditorViewController>( 238 base::MakeUnique<CreditCardEditorViewController>(
239 request_->spec(), request_->state(), this, std::move(on_edited), 239 request_->spec(), request_->state(), this, std::move(on_edited),
240 std::move(on_added), credit_card), 240 std::move(on_added), credit_card),
241 &controller_map_), 241 &controller_map_),
242 /* animate = */ true); 242 /* animate = */ true);
243 if (observer_for_testing_) 243 if (observer_for_testing_)
244 observer_for_testing_->OnCreditCardEditorOpened(); 244 observer_for_testing_->OnCreditCardEditorOpened();
245 } 245 }
246 246
247 void PaymentRequestDialogView::ShowShippingAddressEditor( 247 void PaymentRequestDialogView::ShowShippingAddressEditor(
248 base::OnceClosure on_edited,
249 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added,
248 autofill::AutofillProfile* profile) { 250 autofill::AutofillProfile* profile) {
249 view_stack_->Push(CreateViewAndInstallController( 251 view_stack_->Push(CreateViewAndInstallController(
250 base::MakeUnique<ShippingAddressEditorViewController>( 252 base::MakeUnique<ShippingAddressEditorViewController>(
251 request_->spec(), request_->state(), this, profile), 253 request_->spec(), request_->state(), this,
254 std::move(on_edited), std::move(on_added), profile),
252 &controller_map_), 255 &controller_map_),
253 /* animate = */ true); 256 /* animate = */ true);
254 if (observer_for_testing_) 257 if (observer_for_testing_)
255 observer_for_testing_->OnShippingAddressEditorOpened(); 258 observer_for_testing_->OnShippingAddressEditorOpened();
256 } 259 }
257 260
258 void PaymentRequestDialogView::EditorViewUpdated() { 261 void PaymentRequestDialogView::EditorViewUpdated() {
259 if (observer_for_testing_) 262 if (observer_for_testing_)
260 observer_for_testing_->OnEditorViewUpdated(); 263 observer_for_testing_->OnEditorViewUpdated();
261 } 264 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 // When a view that is associated with a controller is removed from this 328 // When a view that is associated with a controller is removed from this
326 // view's descendants, dispose of the controller. 329 // view's descendants, dispose of the controller.
327 if (!details.is_add && 330 if (!details.is_add &&
328 controller_map_.find(details.child) != controller_map_.end()) { 331 controller_map_.find(details.child) != controller_map_.end()) {
329 DCHECK(!details.move_view); 332 DCHECK(!details.move_view);
330 controller_map_.erase(details.child); 333 controller_map_.erase(details.child);
331 } 334 }
332 } 335 }
333 336
334 } // namespace payments 337 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698