| OLD | NEW |
| 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" |
| 11 #include "chrome/browser/ui/browser_dialogs.h" |
| 11 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" | 12 #include "chrome/browser/ui/views/payments/contact_info_editor_view_controller.h
" |
| 12 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h" | 13 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h" |
| 13 #include "chrome/browser/ui/views/payments/cvc_unmask_view_controller.h" | 14 #include "chrome/browser/ui/views/payments/cvc_unmask_view_controller.h" |
| 14 #include "chrome/browser/ui/views/payments/error_message_view_controller.h" | 15 #include "chrome/browser/ui/views/payments/error_message_view_controller.h" |
| 15 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" | 16 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" |
| 16 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" | 17 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" |
| 17 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 18 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
| 18 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" | 19 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" |
| 19 #include "chrome/browser/ui/views/payments/profile_list_view_controller.h" | 20 #include "chrome/browser/ui/views/payments/profile_list_view_controller.h" |
| 20 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll
er.h" | 21 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll
er.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 request->spec()->add_observer_for_testing(this); | 69 request->spec()->add_observer_for_testing(this); |
| 69 SetLayoutManager(new views::FillLayout()); | 70 SetLayoutManager(new views::FillLayout()); |
| 70 | 71 |
| 71 view_stack_ = base::MakeUnique<ViewStack>(); | 72 view_stack_ = base::MakeUnique<ViewStack>(); |
| 72 view_stack_->set_owned_by_client(); | 73 view_stack_->set_owned_by_client(); |
| 73 AddChildView(view_stack_.get()); | 74 AddChildView(view_stack_.get()); |
| 74 | 75 |
| 75 SetupSpinnerOverlay(); | 76 SetupSpinnerOverlay(); |
| 76 | 77 |
| 77 ShowInitialPaymentSheet(); | 78 ShowInitialPaymentSheet(); |
| 79 |
| 80 chrome::RecordDialogCreation(chrome::DialogIdentifier::PAYMENT_REQUEST); |
| 78 } | 81 } |
| 79 | 82 |
| 80 PaymentRequestDialogView::~PaymentRequestDialogView() {} | 83 PaymentRequestDialogView::~PaymentRequestDialogView() {} |
| 81 | 84 |
| 82 ui::ModalType PaymentRequestDialogView::GetModalType() const { | 85 ui::ModalType PaymentRequestDialogView::GetModalType() const { |
| 83 return ui::MODAL_TYPE_CHILD; | 86 return ui::MODAL_TYPE_CHILD; |
| 84 } | 87 } |
| 85 | 88 |
| 86 bool PaymentRequestDialogView::Cancel() { | 89 bool PaymentRequestDialogView::Cancel() { |
| 87 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 90 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // When a view that is associated with a controller is removed from this | 343 // When a view that is associated with a controller is removed from this |
| 341 // view's descendants, dispose of the controller. | 344 // view's descendants, dispose of the controller. |
| 342 if (!details.is_add && | 345 if (!details.is_add && |
| 343 controller_map_.find(details.child) != controller_map_.end()) { | 346 controller_map_.find(details.child) != controller_map_.end()) { |
| 344 DCHECK(!details.move_view); | 347 DCHECK(!details.move_view); |
| 345 controller_map_.erase(details.child); | 348 controller_map_.erase(details.child); |
| 346 } | 349 } |
| 347 } | 350 } |
| 348 | 351 |
| 349 } // namespace payments | 352 } // namespace payments |
| OLD | NEW |