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_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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 autofill::AutofillProfile* profile) { | 239 autofill::AutofillProfile* profile) { |
| 239 view_stack_->Push(CreateViewAndInstallController( | 240 view_stack_->Push(CreateViewAndInstallController( |
| 240 base::MakeUnique<ShippingAddressEditorViewController>( | 241 base::MakeUnique<ShippingAddressEditorViewController>( |
| 241 request_->spec(), request_->state(), this, profile), | 242 request_->spec(), request_->state(), this, profile), |
| 242 &controller_map_), | 243 &controller_map_), |
| 243 /* animate = */ true); | 244 /* animate = */ true); |
| 244 if (observer_for_testing_) | 245 if (observer_for_testing_) |
| 245 observer_for_testing_->OnShippingAddressEditorOpened(); | 246 observer_for_testing_->OnShippingAddressEditorOpened(); |
| 246 } | 247 } |
| 247 | 248 |
| 249 void PaymentRequestDialogView::ShowContactInfoEditor( | |
| 250 autofill::AutofillProfile* profile) { | |
| 251 view_stack_->Push(CreateViewAndInstallController( | |
| 252 base::MakeUnique<ContactInfoEditorViewController>( | |
| 253 request_->spec(), request_->state(), this, profile), | |
| 254 &controller_map_), | |
| 255 /* animate = */ true); | |
| 256 if (observer_for_testing_) | |
| 257 observer_for_testing_->OnContactInfoEditorOpened(); | |
|
Mathieu
2017/04/17 02:50:10
testing observer but no test file is included. Did
tmartino
2017/04/18 19:39:18
I'm writing them now. Haven't decided whether to w
| |
| 258 } | |
| 259 | |
| 248 void PaymentRequestDialogView::EditorViewUpdated() { | 260 void PaymentRequestDialogView::EditorViewUpdated() { |
| 249 if (observer_for_testing_) | 261 if (observer_for_testing_) |
| 250 observer_for_testing_->OnEditorViewUpdated(); | 262 observer_for_testing_->OnEditorViewUpdated(); |
| 251 } | 263 } |
| 252 | 264 |
| 253 void PaymentRequestDialogView::ShowProcessingSpinner() { | 265 void PaymentRequestDialogView::ShowProcessingSpinner() { |
| 254 throbber_.Start(); | 266 throbber_.Start(); |
| 255 throbber_overlay_.SetVisible(true); | 267 throbber_overlay_.SetVisible(true); |
| 256 } | 268 } |
| 257 | 269 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 // When a view that is associated with a controller is removed from this | 327 // When a view that is associated with a controller is removed from this |
| 316 // view's descendants, dispose of the controller. | 328 // view's descendants, dispose of the controller. |
| 317 if (!details.is_add && | 329 if (!details.is_add && |
| 318 controller_map_.find(details.child) != controller_map_.end()) { | 330 controller_map_.find(details.child) != controller_map_.end()) { |
| 319 DCHECK(!details.move_view); | 331 DCHECK(!details.move_view); |
| 320 controller_map_.erase(details.child); | 332 controller_map_.erase(details.child); |
| 321 } | 333 } |
| 322 } | 334 } |
| 323 | 335 |
| 324 } // namespace payments | 336 } // namespace payments |
| OLD | NEW |