• Christopher Cameron's avatar
    RemoteMacViews: Add mojo interface for WebContentsViewMac · ed40bff2
    Christopher Cameron authored
    The NSView hierarchy for most windows is
    - BridgedNativeWidget
      - WebContentsView (*)
        - RenderWidgetHostView
    This patch adds a cross-process interface for WebContentsView. This
    interface created via the NSViewBridgeFactory interface, using the
    new mojo method CreateWebContentsNSViewBridge.
    
    Add the mojo interface content::mojom::WebContentsNSViewBridge and
    content::mojom::WebContentsNSViewClient.
    - The interface that is exposed is motivated by the native Cocoa calls
      made by views::NativeViewHostMac (which are targeting the
      WebContentsViewCocoa).
    - Note that this interface is public (unlike RenderWidgetHostNSView)
      because it doesn't have any content-private dependencies.
    
    Add methods to the C++ interface ui::ViewsHostableView (which is
    implemented by WebContentsViewMac), to perform all of the functions
    currently done by Cocoa calls on WebContentsViewCocoa.
    
    Add the class content::WebContentsNSViewBridge, which implements the
    new mojo interface.
    - This performs the same Cocoa calls that are done in the browswer
      process.
    - Note that this class does not instantiate WebContentsViewCocoa (the
      NSView sub-class used by WebContents), rather, it uses a vanilla
      NSView. This may change in the future, if need be.
    - Note that this NSView is in addition to the WebContentsViewCocoa
      created in the browser process (not in place of it).
    
    Update RenderWidgetHostMac::MigrateNSViewBridge to take the arguments
    that content::WebContentsViewMac will send it.
    
    Bug: 821651
    Change-Id: Ic1dd5c469a8dab32837cdf23cdda34d24d6240cb
    Reviewed-on: https://chromium-review.googlesource.com/1253095
    Commit-Queue: ccameron <ccameron@chromium.org>
    Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#595751}
    ed40bff2
ns_view_bridge_factory_impl.mm 2.29 KB