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" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 void PaymentRequestDialogView::ShowInitialPaymentSheet() { | 194 void PaymentRequestDialogView::ShowInitialPaymentSheet() { |
| 195 view_stack_.Push(CreateViewAndInstallController( | 195 view_stack_.Push(CreateViewAndInstallController( |
| 196 base::MakeUnique<PaymentSheetViewController>( | 196 base::MakeUnique<PaymentSheetViewController>( |
| 197 request_->spec(), request_->state(), this), | 197 request_->spec(), request_->state(), this), |
| 198 &controller_map_), | 198 &controller_map_), |
| 199 /* animate = */ false); | 199 /* animate = */ false); |
| 200 if (observer_for_testing_) | 200 if (observer_for_testing_) |
| 201 observer_for_testing_->OnDialogOpened(); | 201 observer_for_testing_->OnDialogOpened(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 gfx::Size PaymentRequestDialogView::GetPreferredSize() const { | 204 gfx::Size PaymentRequestDialogView::GetUnsnappedPreferredSize() const { |
| 205 return gfx::Size(450, 450); | 205 return gfx::Size(450, 450); |
|
Peter Kasting
2017/03/30 00:35:35
Another case that needs a bug filed
| |
| 206 } | 206 } |
| 207 | 207 |
| 208 void PaymentRequestDialogView::ViewHierarchyChanged( | 208 void PaymentRequestDialogView::ViewHierarchyChanged( |
| 209 const ViewHierarchyChangedDetails& details) { | 209 const ViewHierarchyChangedDetails& details) { |
| 210 if (being_closed_) | 210 if (being_closed_) |
| 211 return; | 211 return; |
| 212 | 212 |
| 213 // When a view that is associated with a controller is removed from this | 213 // When a view that is associated with a controller is removed from this |
| 214 // view's descendants, dispose of the controller. | 214 // view's descendants, dispose of the controller. |
| 215 if (!details.is_add && | 215 if (!details.is_add && |
| 216 controller_map_.find(details.child) != controller_map_.end()) { | 216 controller_map_.find(details.child) != controller_map_.end()) { |
| 217 DCHECK(!details.move_view); | 217 DCHECK(!details.move_view); |
| 218 controller_map_.erase(details.child); | 218 controller_map_.erase(details.child); |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace payments | 222 } // namespace payments |
| OLD | NEW |