Chromium Code Reviews| 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.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_dialog.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/order_summary_view_controller.h" | 11 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" |
| 12 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" | 12 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" |
| 13 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" | 13 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" |
| 14 #include "chrome/browser/ui/views/payments/shipping_list_view_controller.h" | |
| 14 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
| 15 #include "components/constrained_window/constrained_window_views.h" | 16 #include "components/constrained_window/constrained_window_views.h" |
| 16 #include "components/payments/payment_request.h" | 17 #include "components/payments/payment_request.h" |
| 17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 19 #include "ui/views/layout/fill_layout.h" | 20 #include "ui/views/layout/fill_layout.h" |
| 20 | 21 |
| 21 namespace chrome { | 22 namespace chrome { |
| 22 | 23 |
| 23 void ShowPaymentRequestDialog(payments::PaymentRequest* request) { | 24 void ShowPaymentRequestDialog(payments::PaymentRequest* request) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 void PaymentRequestDialog::GoBack() { | 92 void PaymentRequestDialog::GoBack() { |
| 92 view_stack_.Pop(); | 93 view_stack_.Pop(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void PaymentRequestDialog::ShowOrderSummary() { | 96 void PaymentRequestDialog::ShowOrderSummary() { |
| 96 view_stack_.Push(CreateViewAndInstallController<OrderSummaryViewController>( | 97 view_stack_.Push(CreateViewAndInstallController<OrderSummaryViewController>( |
| 97 &controller_map_, request_, this), | 98 &controller_map_, request_, this), |
| 98 true); | 99 true); |
| 99 } | 100 } |
| 100 | 101 |
| 102 void PaymentRequestDialog::ShowShippingListSheet() { | |
| 103 view_stack_.Push(CreateViewAndInstallController<ShippingListViewController>( | |
| 104 &controller_map_, request_, this), | |
| 105 true); | |
|
please use gerrit instead
2017/01/20 19:32:53
Please add a comment about the meaning of this "tr
tmartino
2017/01/25 00:08:41
Done here and for the other calls to Push in this
| |
| 106 } | |
| 107 | |
| 101 void PaymentRequestDialog::ShowPaymentMethodSheet() { | 108 void PaymentRequestDialog::ShowPaymentMethodSheet() { |
| 102 view_stack_.Push( | 109 view_stack_.Push( |
| 103 CreateViewAndInstallController<PaymentMethodViewController>( | 110 CreateViewAndInstallController<PaymentMethodViewController>( |
| 104 &controller_map_, request_, this), | 111 &controller_map_, request_, this), |
| 105 true); | 112 true); |
| 106 } | 113 } |
| 107 | 114 |
| 108 void PaymentRequestDialog::CloseDialog() { | 115 void PaymentRequestDialog::CloseDialog() { |
| 109 GetWidget()->Close(); | 116 GetWidget()->Close(); |
| 110 } | 117 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 124 // When a view that is associated with a controller is removed from this | 131 // When a view that is associated with a controller is removed from this |
| 125 // view's descendants, dispose of the controller. | 132 // view's descendants, dispose of the controller. |
| 126 if (!details.is_add && | 133 if (!details.is_add && |
| 127 controller_map_.find(details.child) != controller_map_.end()) { | 134 controller_map_.find(details.child) != controller_map_.end()) { |
| 128 DCHECK(!details.move_view); | 135 DCHECK(!details.move_view); |
| 129 controller_map_.erase(details.child); | 136 controller_map_.erase(details.child); |
| 130 } | 137 } |
| 131 } | 138 } |
| 132 | 139 |
| 133 } // namespace payments | 140 } // namespace payments |
| OLD | NEW |