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/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/cvc_unmask_view_controller.h" | 13 #include "chrome/browser/ui/views/payments/cvc_unmask_view_controller.h" |
13 #include "chrome/browser/ui/views/payments/error_message_view_controller.h" | 14 #include "chrome/browser/ui/views/payments/error_message_view_controller.h" |
14 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" | 15 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h" |
15 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" | 16 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" |
16 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 17 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
17 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" | 18 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" |
18 #include "chrome/browser/ui/views/payments/profile_list_view_controller.h" | 19 #include "chrome/browser/ui/views/payments/profile_list_view_controller.h" |
19 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll
er.h" | 20 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll
er.h" |
20 #include "chrome/browser/ui/views/payments/shipping_option_view_controller.h" | 21 #include "chrome/browser/ui/views/payments/shipping_option_view_controller.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 request->spec()->add_observer_for_testing(this); | 68 request->spec()->add_observer_for_testing(this); |
68 SetLayoutManager(new views::FillLayout()); | 69 SetLayoutManager(new views::FillLayout()); |
69 | 70 |
70 view_stack_ = base::MakeUnique<ViewStack>(); | 71 view_stack_ = base::MakeUnique<ViewStack>(); |
71 view_stack_->set_owned_by_client(); | 72 view_stack_->set_owned_by_client(); |
72 AddChildView(view_stack_.get()); | 73 AddChildView(view_stack_.get()); |
73 | 74 |
74 SetupSpinnerOverlay(); | 75 SetupSpinnerOverlay(); |
75 | 76 |
76 ShowInitialPaymentSheet(); | 77 ShowInitialPaymentSheet(); |
| 78 |
| 79 chrome::RecordDialogCreation(chrome::DialogIdentifier::PAYMENT_REQUEST); |
77 } | 80 } |
78 | 81 |
79 PaymentRequestDialogView::~PaymentRequestDialogView() {} | 82 PaymentRequestDialogView::~PaymentRequestDialogView() {} |
80 | 83 |
81 ui::ModalType PaymentRequestDialogView::GetModalType() const { | 84 ui::ModalType PaymentRequestDialogView::GetModalType() const { |
82 return ui::MODAL_TYPE_CHILD; | 85 return ui::MODAL_TYPE_CHILD; |
83 } | 86 } |
84 | 87 |
85 bool PaymentRequestDialogView::Cancel() { | 88 bool PaymentRequestDialogView::Cancel() { |
86 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 89 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |