• Christopher Cameron's avatar
    RemoteMacViews: Remove browser dependencies of SetBounds · 5f99a2c0
    Christopher Cameron authored
    The function BridgedNativeWidget::SetBounds calls back into the
    NativeWidgetMac to determine
    - the minimum content size
    - if the widget's position should be relative to the parent or the
      screen (and the offset to do that computation)
    - if the widget is a modal sheet
    This call will eventually be running in the app shim process, where
    these values will not be available (without adding a synchronous IPC).
    
    Change NativeWidgetMac::SetBounds to call BridgedNativeWidgetHostImpl::
    SetBounds, and have that function pre-compute the required parameters,
    - minimum content size
    - offset necessary to be applied to compensate for position being
      relative to the parent or the screen
    - (but not if the widget is a modal sheet, that's coming later)
    and pass these as parameters to BridgedNativeWidget::SetBounds.
    
    Split out the SetBounds calls made during initialization from
    being within BridgedNativeWidget::Init to being made by its caller,
    BridgedNativeWidgetHostImpl::InitWindow, to allow the additional
    parameters to be passed in.
    
    Bug: 859152
    Change-Id: I2f33ab08f60d2ed1bc3b6af5ecf3402e3715ffd4
    Reviewed-on: https://chromium-review.googlesource.com/1178813
    Commit-Queue: ccameron <ccameron@chromium.org>
    Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#584327}
    5f99a2c0
bridged_native_widget.mm 45.9 KB