| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 layout->StartRow(0.5, 1); | 326 layout->StartRow(0.5, 1); |
| 327 layout->AddView(new views::Label( | 327 layout->AddView(new views::Label( |
| 328 l10n_util::GetStringUTF16(IDS_PAYMENTS_PROCESSING_MESSAGE))); | 328 l10n_util::GetStringUTF16(IDS_PAYMENTS_PROCESSING_MESSAGE))); |
| 329 | 329 |
| 330 throbber_overlay_.SetLayoutManager(layout.release()); | 330 throbber_overlay_.SetLayoutManager(layout.release()); |
| 331 AddChildView(&throbber_overlay_); | 331 AddChildView(&throbber_overlay_); |
| 332 } | 332 } |
| 333 | 333 |
| 334 gfx::Size PaymentRequestDialogView::GetPreferredSize() const { | 334 gfx::Size PaymentRequestDialogView::GetPreferredSize() const { |
| 335 return gfx::Size(kDialogWidth, kDialogHeight); | 335 return gfx::Size(GetActualDialogWidth(), kDialogHeight); |
| 336 } | 336 } |
| 337 | 337 |
| 338 void PaymentRequestDialogView::ViewHierarchyChanged( | 338 void PaymentRequestDialogView::ViewHierarchyChanged( |
| 339 const ViewHierarchyChangedDetails& details) { | 339 const ViewHierarchyChangedDetails& details) { |
| 340 if (being_closed_) | 340 if (being_closed_) |
| 341 return; | 341 return; |
| 342 | 342 |
| 343 // When a view that is associated with a controller is removed from this | 343 // When a view that is associated with a controller is removed from this |
| 344 // view's descendants, dispose of the controller. | 344 // view's descendants, dispose of the controller. |
| 345 if (!details.is_add && | 345 if (!details.is_add && |
| 346 controller_map_.find(details.child) != controller_map_.end()) { | 346 controller_map_.find(details.child) != controller_map_.end()) { |
| 347 DCHECK(!details.move_view); | 347 DCHECK(!details.move_view); |
| 348 controller_map_.erase(details.child); | 348 controller_map_.erase(details.child); |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace payments | 352 } // namespace payments |
| OLD | NEW |