Chromium Code Reviews| Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm |
| diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm |
| index 775ae154665490be79c47801ddf24210e1f13479..9bd73cf17d8034ecb1b89693874871ce40ca4b17 100644 |
| --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm |
| +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm |
| @@ -20,13 +20,13 @@ |
| - (void)updateSheetPosition { |
| if (web_dialog_delegate_) { |
| - gfx::Size size; |
| + // If the dialog has autoresizing enabled and |current_size_| has been set, |
| + // GetDialogSize() doesn't modify |size|. |
| + gfx::Size size(current_size_.width, current_size_.height); |
| web_dialog_delegate_->GetDialogSize(&size); |
| + DCHECK(!size.IsEmpty()); |
|
groby-ooo-7-16
2016/09/14 19:30:02
I'm assuming this triggers only if updateSheetPosi
takumif
2016/09/14 21:46:43
Right, the problem was with updateSheetPosition be
|
| - // If the dialog has autoresizing enabled, |size| will be empty. Use the |
| - // last known dialog size. |
| - NSSize content_size = size.IsEmpty() ? current_size_ : |
| - NSMakeSize(size.width(), size.height()); |
| + NSSize content_size = NSMakeSize(size.width(), size.height()); |
| [customWindow_ setContentSize:content_size]; |
| } |
| [super updateSheetPosition]; |