| 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/views/payments/contact_info_view_controller.h" |
| 11 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h" | 12 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h" |
| 12 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" | 13 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" |
| 13 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" | 14 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" |
| 14 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" | 15 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" |
| 15 #include "chrome/browser/ui/views/payments/shipping_list_view_controller.h" | 16 #include "chrome/browser/ui/views/payments/shipping_list_view_controller.h" |
| 16 #include "components/constrained_window/constrained_window_views.h" | 17 #include "components/constrained_window/constrained_window_views.h" |
| 17 #include "components/payments/content/payment_request.h" | 18 #include "components/payments/content/payment_request.h" |
| 18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 19 #include "ui/views/layout/fill_layout.h" | 20 #include "ui/views/layout/fill_layout.h" |
| 20 | 21 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return ui::DIALOG_BUTTON_NONE; | 90 return ui::DIALOG_BUTTON_NONE; |
| 90 } | 91 } |
| 91 | 92 |
| 92 void PaymentRequestDialogView::GoBack() { | 93 void PaymentRequestDialogView::GoBack() { |
| 93 view_stack_.Pop(); | 94 view_stack_.Pop(); |
| 94 | 95 |
| 95 if (observer_for_testing_) | 96 if (observer_for_testing_) |
| 96 observer_for_testing_->OnBackNavigation(); | 97 observer_for_testing_->OnBackNavigation(); |
| 97 } | 98 } |
| 98 | 99 |
| 100 void PaymentRequestDialogView::ShowContactInfoSheet() { |
| 101 view_stack_.Push( |
| 102 CreateViewAndInstallController( |
| 103 base::MakeUnique<ContactInfoViewController>(request_, this), |
| 104 &controller_map_), |
| 105 /* animate */ true); |
| 106 if (observer_for_testing_) |
| 107 observer_for_testing_->OnContactInfoOpened(); |
| 108 } |
| 109 |
| 99 void PaymentRequestDialogView::ShowOrderSummary() { | 110 void PaymentRequestDialogView::ShowOrderSummary() { |
| 100 view_stack_.Push( | 111 view_stack_.Push( |
| 101 CreateViewAndInstallController( | 112 CreateViewAndInstallController( |
| 102 base::MakeUnique<OrderSummaryViewController>(request_, this), | 113 base::MakeUnique<OrderSummaryViewController>(request_, this), |
| 103 &controller_map_), | 114 &controller_map_), |
| 104 /* animate = */ true); | 115 /* animate = */ true); |
| 105 if (observer_for_testing_) | 116 if (observer_for_testing_) |
| 106 observer_for_testing_->OnOrderSummaryOpened(); | 117 observer_for_testing_->OnOrderSummaryOpened(); |
| 107 } | 118 } |
| 108 | 119 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // When a view that is associated with a controller is removed from this | 173 // When a view that is associated with a controller is removed from this |
| 163 // view's descendants, dispose of the controller. | 174 // view's descendants, dispose of the controller. |
| 164 if (!details.is_add && | 175 if (!details.is_add && |
| 165 controller_map_.find(details.child) != controller_map_.end()) { | 176 controller_map_.find(details.child) != controller_map_.end()) { |
| 166 DCHECK(!details.move_view); | 177 DCHECK(!details.move_view); |
| 167 controller_map_.erase(details.child); | 178 controller_map_.erase(details.child); |
| 168 } | 179 } |
| 169 } | 180 } |
| 170 | 181 |
| 171 } // namespace payments | 182 } // namespace payments |
| OLD | NEW |