• Christopher Cameron's avatar
    RemoteMacViews: Remove browser dependencies of SetBounds · cd4d9d7f
    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.
    
    This is a re-land of crrev.com/584327 (reverted in crrev.com/584339)
    with the logic for initial bounds setting separated out into the
    BridgedNativeWidget::SetInitialBounds (merging the behaviors was too
    ambitious).
    
    TBR=ellyjones (original reviewer)
    
    Bug: 859152
    Change-Id: I98b6a5d419e586fb2697ef3b45fdc19c73f9c619
    Reviewed-on: https://chromium-review.googlesource.com/1180715Reviewed-by: default avatarccameron <ccameron@chromium.org>
    Commit-Queue: ccameron <ccameron@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#584363}
    cd4d9d7f
bridged_native_widget.mm 46 KB