| 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_editor_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/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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 autofill::AutofillProfile* profile) { | 249 autofill::AutofillProfile* profile) { |
| 249 view_stack_->Push(CreateViewAndInstallController( | 250 view_stack_->Push(CreateViewAndInstallController( |
| 250 base::MakeUnique<ShippingAddressEditorViewController>( | 251 base::MakeUnique<ShippingAddressEditorViewController>( |
| 251 request_->spec(), request_->state(), this, profile), | 252 request_->spec(), request_->state(), this, profile), |
| 252 &controller_map_), | 253 &controller_map_), |
| 253 /* animate = */ true); | 254 /* animate = */ true); |
| 254 if (observer_for_testing_) | 255 if (observer_for_testing_) |
| 255 observer_for_testing_->OnShippingAddressEditorOpened(); | 256 observer_for_testing_->OnShippingAddressEditorOpened(); |
| 256 } | 257 } |
| 257 | 258 |
| 259 void PaymentRequestDialogView::ShowContactInfoEditor( |
| 260 autofill::AutofillProfile* profile) { |
| 261 view_stack_->Push(CreateViewAndInstallController( |
| 262 base::MakeUnique<ContactInfoEditorViewController>( |
| 263 request_->spec(), request_->state(), this, profile), |
| 264 &controller_map_), |
| 265 /* animate = */ true); |
| 266 if (observer_for_testing_) |
| 267 observer_for_testing_->OnContactInfoEditorOpened(); |
| 268 } |
| 269 |
| 258 void PaymentRequestDialogView::EditorViewUpdated() { | 270 void PaymentRequestDialogView::EditorViewUpdated() { |
| 259 if (observer_for_testing_) | 271 if (observer_for_testing_) |
| 260 observer_for_testing_->OnEditorViewUpdated(); | 272 observer_for_testing_->OnEditorViewUpdated(); |
| 261 } | 273 } |
| 262 | 274 |
| 263 void PaymentRequestDialogView::ShowProcessingSpinner() { | 275 void PaymentRequestDialogView::ShowProcessingSpinner() { |
| 264 throbber_.Start(); | 276 throbber_.Start(); |
| 265 throbber_overlay_.SetVisible(true); | 277 throbber_overlay_.SetVisible(true); |
| 266 } | 278 } |
| 267 | 279 |
| (...skipping 57 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 | 337 // When a view that is associated with a controller is removed from this |
| 326 // view's descendants, dispose of the controller. | 338 // view's descendants, dispose of the controller. |
| 327 if (!details.is_add && | 339 if (!details.is_add && |
| 328 controller_map_.find(details.child) != controller_map_.end()) { | 340 controller_map_.find(details.child) != controller_map_.end()) { |
| 329 DCHECK(!details.move_view); | 341 DCHECK(!details.move_view); |
| 330 controller_map_.erase(details.child); | 342 controller_map_.erase(details.child); |
| 331 } | 343 } |
| 332 } | 344 } |
| 333 | 345 |
| 334 } // namespace payments | 346 } // namespace payments |
| OLD | NEW |