Chrome Version : 58.0.3018.3
For Issue 165193 "Hide Submit and Cancel during sign in new autofill dialog", some logic was added to DialogClientView to ignore the "ExtraView" when performing layout in DialogClientView.
But the client dialog (for RequestAutocomplete) was removed in r391821
Other dialogs do still set the extra view hidden (e.g. DesktopMediaPickerDialogView).
The question is: should this affect layout?
That is, DialogClientView can be simplified if a dialog that provides an `ExtraView` always performs layout assuming the extra view is present. The view can still be hidden, but it will always occupy space in the button row.
Currently, hiding the extra view acts as though the view is not there at all, and the dialog's PreferredSize will adjust.
Since dialogs typically do not resize the entire Window after the initial display, accounting for the size of a hidden-view-that-may-become-visible-later is probably even a desirable. If a dialog shouldn't be initially sized with the extra view occupying space, the DialogDelegate needs to return null from CreateExtraView.
Current use cases can still be supported:
- delegates can simply `delete` the extra view to remove it from the hierarchy
- delegates can later decide to return non-null from CreateExtraView(), and call UpdateDialogButtons()
- delegates can size the extra view to 0x0 and provide 0 in an override of GetExtraViewPadding()