New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 821651 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Feature



Sign in to add a comment

mac: Host RenderWidgetHostViewMac in AppShim process

Project Member Reported by ccameron@chromium.org, Mar 14 2018

Issue description

Slice the connection between RenderWidgetHostViewMac and RenderWidgetHostViewCocoa so that the NSView can be hosted in the AppShim process.

This is unlikely to ship independently of mac_views_browser=1, so the actual NSWindow hosting will be hacky (solving that problem is relegated to RemoteMacViews).
 
Labels: -Type-Bug Type-Feature
Cc: tapted@chromium.org
Components: UI>Browser>WebAppInstalls
+tapted (around for at least the next 2 months :))
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0741e800394753d6041367eab90acd31c43e61a7

commit 0741e800394753d6041367eab90acd31c43e61a7
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Mar 16 22:51:41 2018

Add a feature flag to create app windows in the AppShim process

This feature is to allow the creation of NSWindows in the app shim
process instead of the Chrome browser process.

AppShim instances will inherit the behavior of whatever Chrome
instance they attach to.

If the Chrome instance has this feature enabled, then it will send
messages to the AppShim telling it to establish connections to
create windows.

Bug:  821651 
Change-Id: Ieaef0f8c61fc93e6c187a8c5e4e21c9ff2a740eb
Reviewed-on: https://chromium-review.googlesource.com/965268
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543856}
[modify] https://crrev.com/0741e800394753d6041367eab90acd31c43e61a7/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc
[modify] https://crrev.com/0741e800394753d6041367eab90acd31c43e61a7/ui/base/ui_base_features.cc
[modify] https://crrev.com/0741e800394753d6041367eab90acd31c43e61a7/ui/base/ui_base_features.h

See also tapted's original  issue 308382 .
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a1e03470f144852659f994b7b6ed8b4b940f85c

commit 6a1e03470f144852659f994b7b6ed8b4b940f85c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Mon Mar 19 21:04:27 2018

Create separate files for RWHVMac and RWHVCocoa

This is towards being able to host RWHVCocoa in another process (though
it is worth doing on its on merits, as the source files are getting far
too heavy).

Bug:  821651 
Change-Id: Id379e21defdf0b5e68eab96d1463a7972f2e9b20
Reviewed-on: https://chromium-review.googlesource.com/969404
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544156}
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/BUILD.gn
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/frame_host/popup_menu_helper_mac.mm
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/DEPS
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/input/synthetic_gesture_target_mac.mm
[add] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/render_widget_host_view_cocoa.h
[add] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/render_widget_host_view_mac_dictionary_helper.mm
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/public/test/content_browser_test_utils_mac.mm
[modify] https://crrev.com/6a1e03470f144852659f994b7b6ed8b4b940f85c/content/public/test/text_input_test_utils_mac.mm

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1e229ef1196b70292b4e5a5591bc73d39f93c63d

commit 1e229ef1196b70292b4e5a5591bc73d39f93c63d
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Mar 21 06:54:08 2018

Introduce interface between RWHVMac and RWHVCocoa

We will be moving RWHVCocoa into a separate process from RWHVMac.
The two classes are currently very tightly coupled.

Add RenderWidgetHostNSViewBridge as the RHWVMac->RWHVCocoa interface.
The implementation RenderWidgetHostViewNSViewBridgeLocal is to be
instantiated in the same process as the NSView (this will be the
browser for now and later also the AppShim).

Add RenderWidgetHostNSViewClient as the RHWVCocoa->RWHVMac interface.

Put both of these classes in render_widget_host_view_mac.h for the
moment, to avoid churn. The end-state is that RHWVCocoa will be an
private interface, only accessed via RenderWidgetHostNSViewBridge.

Remote the .get() from renderWidgetHostView_.get() in RWHVCocoa, and
change cocoa_view_ to cocoa_view() in RWHVMac.

R=tapted
TBR=avi (content/ OWNERship)

Bug:  821651 
Change-Id: I5563bfb99ea2c9582798c9353fd3c5395b993ba2
Reviewed-on: https://chromium-review.googlesource.com/969975
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544648}
[modify] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/BUILD.gn
[add] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[add] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[add] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/1e229ef1196b70292b4e5a5591bc73d39f93c63d/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 7 by bugdroid1@chromium.org, Mar 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/99341850cb8c2b7edf0b9802d0411be77f6111d4

commit 99341850cb8c2b7edf0b9802d0411be77f6111d4
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Mar 22 18:18:23 2018

Remove redundant code from RWHVCocoa, move some code to RWHVNSViewBridge

Remove suppressNextEscapeKeyUp_ because its functionality is made
redundant by keyDownCodes_. The escape-key-specific version was
introduced in crrev.com/165615 while the generic version was introduced
in crrev.com/304728.

While in the -[NSView keyEvent:] method, replace repeated method calls
with local variables in preparation for moving most of the funciton
across an IPC boundary, and fold shouldAutohideCursorForEvent into
the function (since it's called nowhere else).

Move SetBackgroundColor and Show/Hide/IsHidden functionality into
the RWHVNSViewBridge.

Bug:  821651 
Change-Id: I31382a46b330fedbd3c4a6593ffafdb4a0b83be1
Reviewed-on: https://chromium-review.googlesource.com/974887
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545160}
[modify] https://crrev.com/99341850cb8c2b7edf0b9802d0411be77f6111d4/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/99341850cb8c2b7edf0b9802d0411be77f6111d4/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/99341850cb8c2b7edf0b9802d0411be77f6111d4/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/99341850cb8c2b7edf0b9802d0411be77f6111d4/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/99341850cb8c2b7edf0b9802d0411be77f6111d4/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/99341850cb8c2b7edf0b9802d0411be77f6111d4/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 8 by bugdroid1@chromium.org, Mar 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0fb2b596b05350d741d727c42b02eacf089f892b

commit 0fb2b596b05350d741d727c42b02eacf089f892b
Author: Moe Ahmadi <mahmadi@chromium.org>
Date: Thu Mar 22 19:21:09 2018

Revert "Remove redundant code from RWHVCocoa, move some code to RWHVNSViewBridge"

This reverts commit 99341850cb8c2b7edf0b9802d0411be77f6111d4.

Reason for revert: Causing compilation failure
https://ci.chromium.org/buildbot/chromium/Mac/39586

Original change's description:
> Remove redundant code from RWHVCocoa, move some code to RWHVNSViewBridge
> 
> Remove suppressNextEscapeKeyUp_ because its functionality is made
> redundant by keyDownCodes_. The escape-key-specific version was
> introduced in crrev.com/165615 while the generic version was introduced
> in crrev.com/304728.
> 
> While in the -[NSView keyEvent:] method, replace repeated method calls
> with local variables in preparation for moving most of the funciton
> across an IPC boundary, and fold shouldAutohideCursorForEvent into
> the function (since it's called nowhere else).
> 
> Move SetBackgroundColor and Show/Hide/IsHidden functionality into
> the RWHVNSViewBridge.
> 
> Bug:  821651 
> Change-Id: I31382a46b330fedbd3c4a6593ffafdb4a0b83be1
> Reviewed-on: https://chromium-review.googlesource.com/974887
> Commit-Queue: ccameron <ccameron@chromium.org>
> Reviewed-by: Trent Apted <tapted@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#545160}

TBR=tapted@chromium.org,ccameron@chromium.org

Change-Id: Idff422824e86d1413026526c61334ac6ead4c3c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  821651 
Reviewed-on: https://chromium-review.googlesource.com/976441
Reviewed-by: Moe Ahmadi <mahmadi@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545186}
[modify] https://crrev.com/0fb2b596b05350d741d727c42b02eacf089f892b/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/0fb2b596b05350d741d727c42b02eacf089f892b/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/0fb2b596b05350d741d727c42b02eacf089f892b/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/0fb2b596b05350d741d727c42b02eacf089f892b/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/0fb2b596b05350d741d727c42b02eacf089f892b/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/0fb2b596b05350d741d727c42b02eacf089f892b/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 9 by bugdroid1@chromium.org, Mar 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/49c09c587af545f40559e4858f82fc7b2f9ced43

commit 49c09c587af545f40559e4858f82fc7b2f9ced43
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Mar 23 19:05:50 2018

Break RWHVMac::InitAsFullscreen

This appears to not be used outside of unit tests.

Add a NOTREACHED to be sure.

Bug:  821651 
Change-Id: I9fb45ce7afd9794aeccf6a01d646d992d1be1be5
Reviewed-on: https://chromium-review.googlesource.com/978463
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545545}
[modify] https://crrev.com/49c09c587af545f40559e4858f82fc7b2f9ced43/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/49c09c587af545f40559e4858f82fc7b2f9ced43/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm

Project Member

Comment 10 by bugdroid1@chromium.org, Mar 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e082cddb5ec98a6f22353ccad008d6aa6487439c

commit e082cddb5ec98a6f22353ccad008d6aa6487439c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Mar 27 00:55:58 2018

RemoteRWHVMac: Push view and window bounds from NSView to RWHVMac

RenderWidgetHostViewMac calls into the -[NSView bounds] and
-[NSWindow frame] and -[NSScreen frame] methods for various reasons.
This no longer going to be allowed when the NSView, NSWindow, and
NSScreen are living in another process.

Add client method OnNSViewBoundsInWindowChanged to inform the RWHVMac
when the NSView's bounds in the window change, along with whether or
not the NSView is currently attached to a window.

Add a client method OnNSViewWindowFrameInScreenChanged to inform the
RWHVMac of the window's motion in the screen.

Store the resulting gfx::Rects in RHWVMac, and update the GetViewBounds
and GetBoundsInRootWindow methods to use that data. Push this data to
BrowserCompositorMac (so that that class no longer queries the NSView
for the data directly).

Change several locations in RHWVMac that were rolling their own version
of mac/coordinate_conversions functions. Add caching to the coordiante
conversion functions (somewhat awkwardly, and add a TODO about it).

Bug:  821651 
Change-Id: I498324f8965bd76031028adfa4f740a5653319f7
Reviewed-on: https://chromium-review.googlesource.com/977229
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545915}
[modify] https://crrev.com/e082cddb5ec98a6f22353ccad008d6aa6487439c/content/browser/renderer_host/browser_compositor_view_mac.h
[modify] https://crrev.com/e082cddb5ec98a6f22353ccad008d6aa6487439c/content/browser/renderer_host/browser_compositor_view_mac.mm
[modify] https://crrev.com/e082cddb5ec98a6f22353ccad008d6aa6487439c/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/e082cddb5ec98a6f22353ccad008d6aa6487439c/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/e082cddb5ec98a6f22353ccad008d6aa6487439c/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/e082cddb5ec98a6f22353ccad008d6aa6487439c/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/e082cddb5ec98a6f22353ccad008d6aa6487439c/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 11 by bugdroid1@chromium.org, Mar 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e72a8bc4fa725e1529e02fdd3955f388aafc2d30

commit e72a8bc4fa725e1529e02fdd3955f388aafc2d30
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Mar 27 02:25:54 2018

RemoteRWHVMac: Push display::Display from NSView to RHWVMac

Add a cached variable for RWHVMac's display::Display.
* Initialize it with the the current key window's display, and
  pass that to BrowserCompositorMac's constructor (and remove
  the equivalent initialization from BrowserCompositorMac).
* Update ui::DisplayLinkMac to use the id from the cached
  display::Display, and move its update code into
  UpdateNSViewAndDisplayProperties (this will usually just be a
  std::map lookup).

Move the display::DisplayObserver implementation from RWHVMac (in
the browser process) to RHWVNSViewBridgeLocal (in the AppShim
process).

Change -[RWHVCocoa updateScreenProperties] to only push a new
display::Display to the RWHVMac when the RWHVCocoa is attached to
a window.

Bug:  821651 
Change-Id: Ifeddf82ca9858e7e9185b068094af45425790ad0
Reviewed-on: https://chromium-review.googlesource.com/979119
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545919}
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/browser_compositor_view_mac.h
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/browser_compositor_view_mac.mm
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/display_util.cc
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/e72a8bc4fa725e1529e02fdd3955f388aafc2d30/ui/display/mac/screen_mac.mm

Project Member

Comment 12 by bugdroid1@chromium.org, Mar 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fe3cbe4db0019275d53a8ecf60401dafb5098a32

commit fe3cbe4db0019275d53a8ecf60401dafb5098a32
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Mar 27 09:00:59 2018

RemoteRWHVMac: Update first responder, key, and tooltip methods

Make RWHVMac call through RWHVNSViewBridge, and make RWHVCocoa call
through RWHVNSViewClient.

Some of these methods depended on knowing if RHWVMac::host() still
existed, so refactor tear-down to add a RWHNSViewBridge::Destroy method
which informs the RHWVCocoa whether or not its |client_| is still
callable. Once RWHVCocoa no longer calls into the RWHVMac directly, all
of these lifetimes will be clean-up-able.

Bug:  821651 
Change-Id: I30f6060ce661504f1eadf933384a6f1cbe4a3c96
Reviewed-on: https://chromium-review.googlesource.com/979595
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546066}
[modify] https://crrev.com/fe3cbe4db0019275d53a8ecf60401dafb5098a32/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/fe3cbe4db0019275d53a8ecf60401dafb5098a32/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/fe3cbe4db0019275d53a8ecf60401dafb5098a32/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/fe3cbe4db0019275d53a8ecf60401dafb5098a32/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/fe3cbe4db0019275d53a8ecf60401dafb5098a32/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/fe3cbe4db0019275d53a8ecf60401dafb5098a32/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/fe3cbe4db0019275d53a8ecf60401dafb5098a32/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 13 by bugdroid1@chromium.org, Mar 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b34682896e0dab3d60b952dc131963b7b0d9123

commit 6b34682896e0dab3d60b952dc131963b7b0d9123
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Mar 29 00:14:23 2018

RemoteRWHVMac: Move InitPopup and SetBounds to AppShim side

Do a verbatim-cut-and-paste of InitPopup and SetBounds (modulo
parameter names) from RWHVMac to PopupWindowMac.

Instantiate PopupWindowMac in RWHNSViewLocalBridge.

R=tapted
TBR=avi (content/)

Bug:  821651 
Change-Id: I1027b09451baeeac231d2acb0eb180c4f3a7e65b
Reviewed-on: https://chromium-review.googlesource.com/979392
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546670}
[modify] https://crrev.com/6b34682896e0dab3d60b952dc131963b7b0d9123/content/browser/BUILD.gn
[add] https://crrev.com/6b34682896e0dab3d60b952dc131963b7b0d9123/content/browser/renderer_host/popup_window_mac.h
[add] https://crrev.com/6b34682896e0dab3d60b952dc131963b7b0d9123/content/browser/renderer_host/popup_window_mac.mm
[modify] https://crrev.com/6b34682896e0dab3d60b952dc131963b7b0d9123/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/6b34682896e0dab3d60b952dc131963b7b0d9123/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/6b34682896e0dab3d60b952dc131963b7b0d9123/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/6b34682896e0dab3d60b952dc131963b7b0d9123/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 14 by bugdroid1@chromium.org, Mar 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5429a98751709e262cdf8d480c3e52f8a1289b6a

commit 5429a98751709e262cdf8d480c3e52f8a1289b6a
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Mar 29 22:37:29 2018

RemoteRWHVMac: Move selected and marked range, context menu, and cursor

Remove references to RWHVCocoa's setMarkedRange, setSelectedRange, and
updateCursor from RWHVMac.

In -[RWHVCocoa, updateCursor], RWHVCocoa reaches back into the
WebContents to see if a context menu is present. To avoid this reach-
back, move the content of RHWVMac::SetShowingContextMenu to RHWVCocoa.

Bug:  821651 
Change-Id: I6052fbc5baefff0f8556336fa96a413bc8ec1f98
Reviewed-on: https://chromium-review.googlesource.com/982976
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546991}
[modify] https://crrev.com/5429a98751709e262cdf8d480c3e52f8a1289b6a/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/5429a98751709e262cdf8d480c3e52f8a1289b6a/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/5429a98751709e262cdf8d480c3e52f8a1289b6a/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/5429a98751709e262cdf8d480c3e52f8a1289b6a/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/5429a98751709e262cdf8d480c3e52f8a1289b6a/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/5429a98751709e262cdf8d480c3e52f8a1289b6a/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 15 by bugdroid1@chromium.org, Mar 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/40633a400c5a4171139a6be5130d594dfee4d924

commit 40633a400c5a4171139a6be5130d594dfee4d924
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Mar 29 23:37:05 2018

RemoteRWHVMac: Send mouse move and wheel events through the client

Cut-and-paste methods for sending blink::WebMouseEvent and
blink::WebMouseWheelEvent to the renderer, cut out of RWHVCocoa, and
added to RWHVMac via the RWHNSViewClient interface.

Bug:  821651 
Change-Id: I659c9ae59d0c2e617e6bc0f895f938091dc13f5e
Reviewed-on: https://chromium-review.googlesource.com/982943
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547019}
[modify] https://crrev.com/40633a400c5a4171139a6be5130d594dfee4d924/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/40633a400c5a4171139a6be5130d594dfee4d924/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/40633a400c5a4171139a6be5130d594dfee4d924/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/40633a400c5a4171139a6be5130d594dfee4d924/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 16 by bugdroid1@chromium.org, Mar 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7dfcc5cc98ae915448f96ad5332393ad268c278e

commit 7dfcc5cc98ae915448f96ad5332393ad268c278e
Author: Christopher Cameron <ccameron@chromium.org>
Date: Sat Mar 31 01:09:42 2018

RWHVMac: Remove InitAsFullscreen support

The NOTREACHED() in InitAsFullscreen has failed appear in crashes, so I
suspect that this has been dead code for a while now.

Bug:  821651 
Change-Id: Ia057b630b8ebb89bc570884979bbd855156e4bf1
Reviewed-on: https://chromium-review.googlesource.com/982580
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547345}
[modify] https://crrev.com/7dfcc5cc98ae915448f96ad5332393ad268c278e/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/7dfcc5cc98ae915448f96ad5332393ad268c278e/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/7dfcc5cc98ae915448f96ad5332393ad268c278e/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/7dfcc5cc98ae915448f96ad5332393ad268c278e/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
[modify] https://crrev.com/7dfcc5cc98ae915448f96ad5332393ad268c278e/ui/base/BUILD.gn
[delete] https://crrev.com/32df8e534feb48fa733814914f60c409f826b81c/ui/base/cocoa/fullscreen_window_manager.h
[delete] https://crrev.com/32df8e534feb48fa733814914f60c409f826b81c/ui/base/cocoa/fullscreen_window_manager.mm
[delete] https://crrev.com/32df8e534feb48fa733814914f60c409f826b81c/ui/base/cocoa/fullscreen_window_manager_unittest.mm

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca

commit 98581bb30ea1eaebee3c3e4fb4c49e4a2446deca
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Apr 10 04:35:10 2018

RemoteRWHVMac: Add dictionary lookup support

Split the RWHVCocoa showLookUpDictionaryOverlayInternal,
showLookUpDictionaryOverlayFromRange, and
showLookUpDictionaryOverlayAtPoint into browser-side and AppShim-side
components.

Remove RenderWidgetHostViewMacDictionaryHelper, because it ends up
having no effect. It is used to specify a target NSView on which to
draw the dictionary overlay, but it is only used for the PDF plugin,
which is incapable of drawing the dictionary overlay (because it
can't look up the point in the view at which it is supposed to be
drawn).

This should be a cut-and-paste with no functional effects.

Bug:  821651 
Change-Id: Ie443bdc76a5e0b28d2f6595fcff0601f8ce4a228
Reviewed-on: https://chromium-review.googlesource.com/1000765
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549421}
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/BUILD.gn
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/frame_host/render_widget_host_view_guest.cc
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/browser/renderer_host/render_widget_host_view_mac.mm
[delete] https://crrev.com/89ad7704f70509658f2ce4a4c8da454e75c46949/content/browser/renderer_host/render_widget_host_view_mac_dictionary_helper.h
[delete] https://crrev.com/89ad7704f70509658f2ce4a4c8da454e75c46949/content/browser/renderer_host/render_widget_host_view_mac_dictionary_helper.mm
[modify] https://crrev.com/98581bb30ea1eaebee3c3e4fb4c49e4a2446deca/content/public/test/text_input_test_utils_mac.mm

Project Member

Comment 19 by bugdroid1@chromium.org, Apr 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e839d826045fb66523574a3a2c19e9dedcd0c422

commit e839d826045fb66523574a3a2c19e9dedcd0c422
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Apr 10 20:04:01 2018

RemoteRWHVMac: Wrap calls to TextInputClientMac

Add synchronous calls to RenderWidgetHostNSViewClient to call into
TextInputClientMac. At present, synchronous doesn't mean anything,
but when the NSView is a separate process, these will correspond to
synchronous IPCs to the browser process.

This covers all calls from Cocoa into TextInputClientMac except for
attributedSubstringForProposedRange, which is idiosyncratic.

Bug:  821651 
Change-Id: Ib64f9823907ed96154a0c15ad18f96da2c58ad30
Reviewed-on: https://chromium-review.googlesource.com/1004296
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549621}
[modify] https://crrev.com/e839d826045fb66523574a3a2c19e9dedcd0c422/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/e839d826045fb66523574a3a2c19e9dedcd0c422/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/e839d826045fb66523574a3a2c19e9dedcd0c422/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/e839d826045fb66523574a3a2c19e9dedcd0c422/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 20 by bugdroid1@chromium.org, Apr 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/095c601eac8547b800c03ae047710a1b740c768a

commit 095c601eac8547b800c03ae047710a1b740c768a
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Apr 11 05:24:21 2018

RemoteRHWVMac: Add remote support for edit commands

Move calls to ExecuteEditCommand to RWHVMac, and add a method on
RWHNSViewClient through which to make these calls.

Move the implementation of Undo/Redo/Cut/Copy/Paste and related
functions from RWHVCocoa to RWHVMac via the RWHNSViewClient interface.

Rename the class RenderWidgetHostViewMacOwner to
RenderWidgetHostNSViewClientOwner, to reflect that it gives access to
a RenderWidgetHostNSViewClient, not a RenderWidgetHostViewMac.

Rename editCommand_helper_ to editCommandHelper_.

Bug:  821651 
Change-Id: I38cc9462f6050b89759a9abf5dcc5b9574a68de1
Reviewed-on: https://chromium-review.googlesource.com/1004297
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549773}
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm
[modify] https://crrev.com/095c601eac8547b800c03ae047710a1b740c768a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm

Project Member

Comment 21 by bugdroid1@chromium.org, Apr 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d42f46ad37357c44b2efe8a84e7627edcc033650

commit d42f46ad37357c44b2efe8a84e7627edcc033650
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Apr 11 07:20:04 2018

RemoteRWHVMac: Add speech API and a band-aid for accessibility

Add methods on RWHNSViewClient to call into the static speech methods
of TextServicesContextMenu.

Add a call to RWHNSViewClient to query if there exists a RenderViewHost
for the current view's RenderWidgetHost, since that query is the only
piece left missing to allow -[RWHVCocoa validateUserInterfaceItem] to
not depend on RWHVMac.

Make RWHVCocoa query the BrowserAccessibilityManager via the
RHWNSViewClient interface, to eliminate another source of direct
calls into RWHVMac. This is explicitly temporary, as we will need to
come up with an accessibility solution for the AppShim process.

Bug:  821651 
Change-Id: I568ed06a0bcbc0384702f494e06238fa635139e4
Reviewed-on: https://chromium-review.googlesource.com/1004444
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549807}
[modify] https://crrev.com/d42f46ad37357c44b2efe8a84e7627edcc033650/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/d42f46ad37357c44b2efe8a84e7627edcc033650/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/d42f46ad37357c44b2efe8a84e7627edcc033650/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/d42f46ad37357c44b2efe8a84e7627edcc033650/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 22 by bugdroid1@chromium.org, Apr 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/accf099ab335e21228dfa324f75d145e08e208c8

commit accf099ab335e21228dfa324f75d145e08e208c8
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Apr 12 20:43:54 2018

RemoteRWHVMac: Add forwarding of Ime and keyboard events

Add functions to RWHNSViewClient to forward keyboard and Ime events.

The messages that are forwarded during a keyboard event are forwarded
to a RenderWidgetHost that is cached at the beginning of the event.
This could potentially be different from the RenderWidgetHost to which
other messages are forwarded.

To ensure that behavior is preserved, bracket the lifetime of
-[RenderWidgetHostViewCocoa keyEvent:] with calls that cause the
RenderWidgetHostViewMac on the other side to save off the target
RenderWidgetHost until the end of the function.

Bug:  821651 
Change-Id: I805aa282b05909604c62a12e4e82133c6aa0e554
Reviewed-on: https://chromium-review.googlesource.com/1005789
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550347}
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 23 by bugdroid1@chromium.org, Apr 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63b9c45c7deb5a42a0d7a0629234ce49da463a73

commit 63b9c45c7deb5a42a0d7a0629234ce49da463a73
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Apr 13 08:22:19 2018

RemoteRWHVMac: Mirror TextSelection and CompositionRangeInfo in NSView

Whenever the TextInputManager::TextSelection or the
TextInputManager::CompositionRangeInfo properties of the RWHVMac change,
forward them to the RWHVCocoa. This is in contrast to the previous
behavior where we would do a synchronous IPC back to the RWHVMac to
query their value.

This is motivated by the attributedSubstringForProposedRange method
in RWHVMac, which would be complicated to implement by a synchronous
IPC.

Remove RWHVCocoa's selectedRange_ member because it is now fully
redundant to the cached copy of the selected range. Leave RWHVCocoa's
markedRange_ member because it is not always equal to the cached
copy of the composition range.

While converting attributedSubstringForProposedRange, fix an overflow
bug, and remove some roll-your-own NSString<->base::string16
conversions.

Rename ClearMarkedText to CancelComposition.

Bug:  821651 
Change-Id: Ieace82d061f15c510762d37e110c70b10eeb2bde
Reviewed-on: https://chromium-review.googlesource.com/1007981
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550545}
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 24 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2135671f788d1d00b31dd8f88e25d7c3c101be76

commit 2135671f788d1d00b31dd8f88e25d7c3c101be76
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Apr 17 03:07:21 2018

RemoteRWHVMac: Clean up RWHVCocoa/Mac lifetime

Historically, RWHVCocoa has owned RWHVMac, because the lifetime of
RWHVCocoa is unpredictable, and we needed to keep the RWHVMac around to
dereference it (the alternative would be to sprinkle "is the RWHVMac
still around" statements throughout).

RWHVCocoa no longer directly references RWHVMac -- all of its
interactions now go through its RWHNSViewClient interface.

Flip this ownership, so that now
- RWHVMac owns a
- RWHVNSViewBridge which owns a
- RWHVCocoa

To solve the issue of RWHVCocoa potentially out-living everything, when
the RWHVMac is destroyed, change RWHVCocoa's RWHNSViewClient to be a
dummy client which just ignores all of the calls made to it.

Make RWHVMac delete itself when its Destroy method is called (just like
Aura).

Delete all of the checks that RWHVCocoa's client_ be non-null, and delete
all of the checks that RWHVMac's browser_compositor_ and ns_view_bridge_
be non-null. These pointers will now be valid for the lifetime of the
objects.

TBR=avi

Bug:  821651 
Change-Id: I568be2a3e0ca7b7abd1a2a2a6f68e4ad37193b51
Reviewed-on: https://chromium-review.googlesource.com/1009482
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551223}
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/2135671f788d1d00b31dd8f88e25d7c3c101be76/content/browser/web_contents/web_contents_impl.cc

Project Member

Comment 25 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/accf099ab335e21228dfa324f75d145e08e208c8

commit accf099ab335e21228dfa324f75d145e08e208c8
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Apr 12 20:43:54 2018

RemoteRWHVMac: Add forwarding of Ime and keyboard events

Add functions to RWHNSViewClient to forward keyboard and Ime events.

The messages that are forwarded during a keyboard event are forwarded
to a RenderWidgetHost that is cached at the beginning of the event.
This could potentially be different from the RenderWidgetHost to which
other messages are forwarded.

To ensure that behavior is preserved, bracket the lifetime of
-[RenderWidgetHostViewCocoa keyEvent:] with calls that cause the
RenderWidgetHostViewMac on the other side to save off the target
RenderWidgetHost until the end of the function.

Bug:  821651 
Change-Id: I805aa282b05909604c62a12e4e82133c6aa0e554
Reviewed-on: https://chromium-review.googlesource.com/1005789
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550347}
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/accf099ab335e21228dfa324f75d145e08e208c8/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 26 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63b9c45c7deb5a42a0d7a0629234ce49da463a73

commit 63b9c45c7deb5a42a0d7a0629234ce49da463a73
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Apr 13 08:22:19 2018

RemoteRWHVMac: Mirror TextSelection and CompositionRangeInfo in NSView

Whenever the TextInputManager::TextSelection or the
TextInputManager::CompositionRangeInfo properties of the RWHVMac change,
forward them to the RWHVCocoa. This is in contrast to the previous
behavior where we would do a synchronous IPC back to the RWHVMac to
query their value.

This is motivated by the attributedSubstringForProposedRange method
in RWHVMac, which would be complicated to implement by a synchronous
IPC.

Remove RWHVCocoa's selectedRange_ member because it is now fully
redundant to the cached copy of the selected range. Leave RWHVCocoa's
markedRange_ member because it is not always equal to the cached
copy of the composition range.

While converting attributedSubstringForProposedRange, fix an overflow
bug, and remove some roll-your-own NSString<->base::string16
conversions.

Rename ClearMarkedText to CancelComposition.

Bug:  821651 
Change-Id: Ieace82d061f15c510762d37e110c70b10eeb2bde
Reviewed-on: https://chromium-review.googlesource.com/1007981
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550545}
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/63b9c45c7deb5a42a0d7a0629234ce49da463a73/content/browser/renderer_host/render_widget_host_view_mac.mm

Cc: mgiuca@chromium.org
Project Member

Comment 28 by bugdroid1@chromium.org, Apr 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e679b81e89275e0df1bad09540834bedf57d668d

commit e679b81e89275e0df1bad09540834bedf57d668d
Author: Christopher Cameron <ccameron@chromium.org>
Date: Mon Apr 23 22:15:07 2018

RemoteRWHVMac: Fix missed nullptr check in firstRectForCharacterRange

In crrev.com/549621, the RenderWidgetHostViewCocoa method
firstRectForCharacterRange was changed from doing an early-out if
!renderWidgetHostView_->GetFocusedWidget() to doing an early-out if
clientWasDestroyed_.

These are not the same thing -- clientWasDestroyed_ is equivalent to
checking host(). Now we're seeing crashes downstream because
OnNSViewSyncGetFirstRectForRange is getting called when
renderWidgetHostView_->GetFocusedWidget() is nullptr.

Fold firstViewRectForCharacterRange into firstRectForCharacterRange,
(since it had no other callers), and update the synchronous method
OnNSViewSyncGetFirstRectForRange to query GetFocusedWidget() and
return a success parameter indicating if it is non-nullptr.

Bug: 835272,  821651 
Change-Id: I5063ed3c154cc1c1efc1f1e903153efc9aef66d1
Reviewed-on: https://chromium-review.googlesource.com/1024411
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552856}
[modify] https://crrev.com/e679b81e89275e0df1bad09540834bedf57d668d/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/e679b81e89275e0df1bad09540834bedf57d668d/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/e679b81e89275e0df1bad09540834bedf57d668d/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/e679b81e89275e0df1bad09540834bedf57d668d/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/e679b81e89275e0df1bad09540834bedf57d668d/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 29 by bugdroid1@chromium.org, Apr 24 2018

Labels: merge-merged-3396
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/89640e46c246faa3c9d6f5aaf42ce6830d984781

commit 89640e46c246faa3c9d6f5aaf42ce6830d984781
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Apr 24 00:48:46 2018

RemoteRWHVMac: Mirror TextSelection and CompositionRangeInfo in NSView

Whenever the TextInputManager::TextSelection or the
TextInputManager::CompositionRangeInfo properties of the RWHVMac change,
forward them to the RWHVCocoa. This is in contrast to the previous
behavior where we would do a synchronous IPC back to the RWHVMac to
query their value.

This is motivated by the attributedSubstringForProposedRange method
in RWHVMac, which would be complicated to implement by a synchronous
IPC.

Remove RWHVCocoa's selectedRange_ member because it is now fully
redundant to the cached copy of the selected range. Leave RWHVCocoa's
markedRange_ member because it is not always equal to the cached
copy of the composition range.

While converting attributedSubstringForProposedRange, fix an overflow
bug, and remove some roll-your-own NSString<->base::string16
conversions.

Rename ClearMarkedText to CancelComposition.

Merging to 3396 for crbug.com/835760 (fix depends on this patch)

TBR=ccameron@chromium.org

(cherry picked from commit 63b9c45c7deb5a42a0d7a0629234ce49da463a73)

Bug:  821651 , 835760
Change-Id: Ieace82d061f15c510762d37e110c70b10eeb2bde
Reviewed-on: https://chromium-review.googlesource.com/1007981
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#550545}
Reviewed-on: https://chromium-review.googlesource.com/1025258
Reviewed-by: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/branch-heads/3396@{#247}
Cr-Branched-From: 9ef2aa869bc7bc0c089e255d698cca6e47d6b038-refs/heads/master@{#550428}
[modify] https://crrev.com/89640e46c246faa3c9d6f5aaf42ce6830d984781/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/89640e46c246faa3c9d6f5aaf42ce6830d984781/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/89640e46c246faa3c9d6f5aaf42ce6830d984781/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/89640e46c246faa3c9d6f5aaf42ce6830d984781/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/89640e46c246faa3c9d6f5aaf42ce6830d984781/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/89640e46c246faa3c9d6f5aaf42ce6830d984781/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/89640e46c246faa3c9d6f5aaf42ce6830d984781/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 30 by bugdroid1@chromium.org, Apr 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7a0407697e8dc518846fc2f46ed5ff518866f1a6

commit 7a0407697e8dc518846fc2f46ed5ff518866f1a6
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Apr 24 00:52:08 2018

RemoteRWHVMac: Clean up RWHVCocoa/Mac lifetime

Historically, RWHVCocoa has owned RWHVMac, because the lifetime of
RWHVCocoa is unpredictable, and we needed to keep the RWHVMac around to
dereference it (the alternative would be to sprinkle "is the RWHVMac
still around" statements throughout).

RWHVCocoa no longer directly references RWHVMac -- all of its
interactions now go through its RWHNSViewClient interface.

Flip this ownership, so that now
- RWHVMac owns a
- RWHVNSViewBridge which owns a
- RWHVCocoa

To solve the issue of RWHVCocoa potentially out-living everything, when
the RWHVMac is destroyed, change RWHVCocoa's RWHNSViewClient to be a
dummy client which just ignores all of the calls made to it.

Make RWHVMac delete itself when its Destroy method is called (just like
Aura).

Delete all of the checks that RWHVCocoa's client_ be non-null, and delete
all of the checks that RWHVMac's browser_compositor_ and ns_view_bridge_
be non-null. These pointers will now be valid for the lifetime of the
objects.

TBR=avi, ccameron@chromium.org

(cherry picked from commit 2135671f788d1d00b31dd8f88e25d7c3c101be76)

Bug:  821651 
Change-Id: I568be2a3e0ca7b7abd1a2a2a6f68e4ad37193b51
Reviewed-on: https://chromium-review.googlesource.com/1009482
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#551223}
Reviewed-on: https://chromium-review.googlesource.com/1025261
Cr-Commit-Position: refs/branch-heads/3396@{#248}
Cr-Branched-From: 9ef2aa869bc7bc0c089e255d698cca6e47d6b038-refs/heads/master@{#550428}
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/7a0407697e8dc518846fc2f46ed5ff518866f1a6/content/browser/web_contents/web_contents_impl.cc

Project Member

Comment 31 by bugdroid1@chromium.org, Apr 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/687d65ea9ad6a439df4a96aee198ff6e1715b875

commit 687d65ea9ad6a439df4a96aee198ff6e1715b875
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Apr 24 00:59:19 2018

RemoteRWHVMac: Fix missed nullptr check in firstRectForCharacterRange

In crrev.com/549621, the RenderWidgetHostViewCocoa method
firstRectForCharacterRange was changed from doing an early-out if
!renderWidgetHostView_->GetFocusedWidget() to doing an early-out if
clientWasDestroyed_.

These are not the same thing -- clientWasDestroyed_ is equivalent to
checking host(). Now we're seeing crashes downstream because
OnNSViewSyncGetFirstRectForRange is getting called when
renderWidgetHostView_->GetFocusedWidget() is nullptr.

Fold firstViewRectForCharacterRange into firstRectForCharacterRange,
(since it had no other callers), and update the synchronous method
OnNSViewSyncGetFirstRectForRange to query GetFocusedWidget() and
return a success parameter indicating if it is non-nullptr.

TBR=ccameron@chromium.org

(cherry picked from commit e679b81e89275e0df1bad09540834bedf57d668d)

Bug: 835272,  821651 
Change-Id: I5063ed3c154cc1c1efc1f1e903153efc9aef66d1
Reviewed-on: https://chromium-review.googlesource.com/1024411
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#552856}
Reviewed-on: https://chromium-review.googlesource.com/1025262
Cr-Commit-Position: refs/branch-heads/3396@{#250}
Cr-Branched-From: 9ef2aa869bc7bc0c089e255d698cca6e47d6b038-refs/heads/master@{#550428}
[modify] https://crrev.com/687d65ea9ad6a439df4a96aee198ff6e1715b875/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/687d65ea9ad6a439df4a96aee198ff6e1715b875/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/687d65ea9ad6a439df4a96aee198ff6e1715b875/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/687d65ea9ad6a439df4a96aee198ff6e1715b875/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/687d65ea9ad6a439df4a96aee198ff6e1715b875/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 32 by bugdroid1@chromium.org, Apr 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/14feeadafb61c7746a4b34c26e0179f31f2015c3

commit 14feeadafb61c7746a4b34c26e0179f31f2015c3
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Apr 26 22:37:27 2018

Remove VSync parameters from ui::AcceleratedWidgetMac

VSync paramteters are specified in two places.
1. In SW and HW compositing,  to the ui::Compositor via
   RenderWidgetHostViewMac::UpdateDisplayVSyncParameters
2. Via viz::SoftwareOutputDeviceMac through its
   gfx::VSyncProvider implementation.

The parameters specified by method 2 are ignored, and are a cause of
lots of extra plumbing. Remove them, and make SoftwareOutputDeviceMac
return nullptr for its vsync provider.

Bug:  821651 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I0f48d1e5a4ae5235d87d840c19f4ce0c8f16e5eb
Reviewed-on: https://chromium-review.googlesource.com/1029958
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554176}
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/components/viz/service/display_embedder/software_output_device_mac.cc
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/components/viz/service/display_embedder/software_output_device_mac.h
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/ui/accelerated_widget_mac/accelerated_widget_mac.h
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/ui/accelerated_widget_mac/accelerated_widget_mac.mm
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/ui/accelerated_widget_mac/ca_layer_frame_sink.h
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/ui/compositor/test/test_compositor_host_mac.mm
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/14feeadafb61c7746a4b34c26e0179f31f2015c3/ui/views/cocoa/bridged_native_widget.mm

Project Member

Comment 33 by bugdroid1@chromium.org, May 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3d6703376c34aa8915bc39ad86163cbb3dccd34f

commit 3d6703376c34aa8915bc39ad86163cbb3dccd34f
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed May 02 10:35:43 2018

RemoteRWHVMac: Pass display parameters through NSViewBridge interface

Separate out the code that is responsible for drawing a ui::Compositor's
content from the ui::AcceleratedWidgetMac interface. Put that code into
the ui::DisplayCALayerTree interface (this is a complement of the
ui::CARendererLayerTree which is used to construct the CALayer tree
in the GPU process, via the viz::DirectRenderer interface).

The ui::DisplayCALayerTree is to be instantiated inside whatever process
owns the NSView that is being displayed (current the browser, but soon
the AppShim process as well). To that end, for RenderWidgetHostViewMac,
instantiate a ui::DisplayCALayerTree in the RWHNSViewBridgeLocal, which
is instantiated in the AppShim process.

With this change, the ui::AcceleratedWidgetMac is only used to provide
a mapping between gfx::AcceleratedWidget and NSView*, and so some
resize-related bookkeeping.

Update RWHVMac, BrowserCompositorViewMac, and BridgedNativeWidgetMac
to use the ui::DisplayCALayerTree interface.

Bug:  821651 
Change-Id: I97b8de898e76dba8ef3a66d51c3887033e000e23
Reviewed-on: https://chromium-review.googlesource.com/1037145
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555340}
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/content/browser/renderer_host/browser_compositor_view_mac.h
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/content/browser/renderer_host/browser_compositor_view_mac.mm
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/accelerated_widget_mac/BUILD.gn
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/accelerated_widget_mac/accelerated_widget_mac.h
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/accelerated_widget_mac/accelerated_widget_mac.mm
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/accelerated_widget_mac/ca_layer_frame_sink.h
[add] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/accelerated_widget_mac/display_ca_layer_tree.h
[add] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/accelerated_widget_mac/display_ca_layer_tree.mm
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/compositor/test/test_compositor_host_mac.mm
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/3d6703376c34aa8915bc39ad86163cbb3dccd34f/ui/views/widget/native_widget_mac_unittest.mm

Project Member

Comment 34 by bugdroid1@chromium.org, May 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a96c130dcf4420411edb5d92ab56eec0adc5cb69

commit a96c130dcf4420411edb5d92ab56eec0adc5cb69
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed May 23 02:31:56 2018

RemoteRWHVMac: Make querying TextInputType not be synchronous

This state can be forwarded to the RenderWidgetHostViewCocoa instead
of being queried using a synchronous callback.

Bug:  821651 
Change-Id: I163946352f2f3f5d7288134dd365504d4bd04912
Reviewed-on: https://chromium-review.googlesource.com/1064980
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560904}
[modify] https://crrev.com/a96c130dcf4420411edb5d92ab56eec0adc5cb69/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/a96c130dcf4420411edb5d92ab56eec0adc5cb69/content/browser/renderer_host/render_widget_host_ns_view_bridge.mm
[modify] https://crrev.com/a96c130dcf4420411edb5d92ab56eec0adc5cb69/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/a96c130dcf4420411edb5d92ab56eec0adc5cb69/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/a96c130dcf4420411edb5d92ab56eec0adc5cb69/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/a96c130dcf4420411edb5d92ab56eec0adc5cb69/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/a96c130dcf4420411edb5d92ab56eec0adc5cb69/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 35 by bugdroid1@chromium.org, Jun 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148

commit d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Jun 19 01:38:48 2018

Migrate macOS AppShim from IPC to mojo

Change IPC messages in app_shim_messages to a mojo interface.
- Remove the AppShimMsg_RequestUserAttention method
- Remove the warning that the interface needs versioning

Update how the connection between shim and browser is initialized
- The connection process is initiated in the shim process in the
  AppShimController::CreateChannelAndSendLaunchApp function
- Make the socket created be an AppShimHost interface (the interface
  used to send from the shim to the browser)
- Immediately enqueue a LaunchApp message to the browser process, and
  add an AppShim interface to the LaunchApp method, to allow the
  browser to call back to the shim process
- Update AppShimHost::ServeChannel to bind itself as a AppShimHost
  to the created socket
- Update AppShimHost::LaunchApp to initialize its AppShim pointer.
  Intentionally do not update this method to have a reply, to minimize
  functional changes. Rather, send the reply via the passed AppShim.

Update how channel errors are handled by adding an error callback
to the mojo bindings created in AppShimHost::LaunchApp and
AppShimController::CreateChannelAndSendLaunchApp.

Update unit tests to use the mojo interfaces. Change AppShimHostTest
to use a weak pointer to the AppShimHost, because, when its message
loop is allowed to run, AppShimHost will delete itself on Close.

Remove the comments about requiring that the interface between the
shim and the browser versioned.

Bug:  821651 
Change-Id: Ibad84de4ec25d1121e4ef4d8075a20bb3abd8642
Reviewed-on: https://chromium-review.googlesource.com/1103844
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568286}
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/app_shim/BUILD.gn
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/app_shim/chrome_main_app_mode_mac.mm
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/browser/apps/app_shim/BUILD.gn
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/browser/apps/app_shim/app_shim_host_mac.cc
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/browser/apps/app_shim/app_shim_host_mac.h
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/browser/apps/app_shim/app_shim_host_manager_browsertest_mac.mm
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/common/BUILD.gn
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/common/mac/OWNERS
[add] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/common/mac/app_shim.mojom
[add] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/common/mac/app_shim.typemap
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/common/mac/app_shim_messages.h
[modify] https://crrev.com/d1a98d01e8db4b4c6dfe92898218ecfb5c7ef148/chrome/typemaps.gni

Project Member

Comment 36 by bugdroid1@chromium.org, Jun 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/98d4956044152d49f60c9fcdb2596c96c4a0be51

commit 98d4956044152d49f60c9fcdb2596c96c4a0be51
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Jun 20 06:58:05 2018

Rename RenderWidgetHostViewNSView to RenderWidgetHostNSView

Also move render_widget_host_ns_view_bridge.mm to
render_widget_host_ns_view_bridge_local.mm, in anticipation of adding a
remote version.

TBR=avi

Bug:  821651 
Change-Id: I90b5a1e85fdb52339a4b30cc65d14cb212741bb0
Reviewed-on: https://chromium-review.googlesource.com/1107389
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568750}
[modify] https://crrev.com/98d4956044152d49f60c9fcdb2596c96c4a0be51/content/browser/BUILD.gn
[rename] https://crrev.com/98d4956044152d49f60c9fcdb2596c96c4a0be51/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm

Project Member

Comment 38 by bugdroid1@chromium.org, Jun 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7238816539f05d1f356639c7be86b33a08ef1883

commit 7238816539f05d1f356639c7be86b33a08ef1883
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Jun 28 02:26:15 2018

RemoteRWHVMac: Mojo-ify RenderWidgetHostNSViewBridge

Replace the C++ interface RenderWidgetHostNSViewBridge with an
equivalent mojo implementation.

Add required native types WebCursor and EncodedAttributedString.

Touch up RenderWidgetHostNSViewBridgeLocal's functions to match new
signatures.

Bug:  821651 
Change-Id: I8e1ed2e842571ffdb28a08b1546ef5996120266a
Reviewed-on: https://chromium-review.googlesource.com/1110755
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571005}
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/browser/BUILD.gn
[delete] https://crrev.com/1fe9dde37b7738c035288ed9dbf2617053871783/content/browser/renderer_host/render_widget_host_ns_view_bridge.h
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/common/BUILD.gn
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/common/native_types.mojom
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/common/native_types.typemap
[modify] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/common/native_types_mac.typemap
[add] https://crrev.com/7238816539f05d1f356639c7be86b33a08ef1883/content/common/render_widget_host_ns_view.mojom

Project Member

Comment 39 by bugdroid1@chromium.org, Jun 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2fd86b41fca243f554de6cbbe43a405eceedf2f0

commit 2fd86b41fca243f554de6cbbe43a405eceedf2f0
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Jun 28 20:37:07 2018

RemoteRWHVMac: Mojo-ify RenderWidgetHostNSViewClient

Not all of RenderWidgetHostNSViewClient can be mojo-ified (e.g, the
method that returns a raw pointer to the accessibility class), and
some may not be a good idea to mojo-ify (event conversion ... which
may not be as big a deal as I make it out to be). To handle this,
create a RenderWidgetHostNSViewLocalClient interface, and two
implementations: RenderWidgetHostViewMac, and ForwardingLocalClient
(which stubs out functionality that isn't present in the app shim, and
converts events to pass over mojo).

Also remove the "OnNSView" prefix from all methods, because it was
excessively verbose.

Remove the stubbed-out NoopClient, because it can now be replaced with
an un-bound mojo instance.

Bug:  821651 
Change-Id: I3c7ab0e910e448292f188001ef5a786d661afb51
Reviewed-on: https://chromium-review.googlesource.com/1116354
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571248}
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_ns_view_client.h
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.mm
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/common/render_widget_host_ns_view.mojom
[modify] https://crrev.com/2fd86b41fca243f554de6cbbe43a405eceedf2f0/content/public/test/text_input_test_utils_mac.mm

Project Member

Comment 40 by bugdroid1@chromium.org, Sep 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5531909177b9231012cdac83a497ee94ee0af0e8

commit 5531909177b9231012cdac83a497ee94ee0af0e8
Author: Christopher Cameron <ccameron@chromium.org>
Date: Mon Sep 24 18:14:44 2018

RemoteRWHVMac: Rename LocalClient to ClientHelper

The interface RenderWidgetHostNSViewLocalClient provides a set of helper
functions that add functionality to a RenderWidgetHostNSViewClient.
These functions may be implemented directly using that Client, or using
a side-channel.

The naming of this class is very confusing as we add the ability to have
local (in-process) and remote (out-of-process) clients. To this end,
rename this to a name that more closely mirrors the names in ui/views
and doesn't these naming ambiguities.

Move the ForwardingLocalClient from render_widget_host_view_cocoa.mm
over to a new render_widget_host_ns_view_client_helper.mm. Change
the instance which is created as a dummy pipe to always be identified
as a dummy pipe.

Bug:  821651 
Change-Id: I1dd130ddbed46d4854a065fa3d629b7f9833824c
Reviewed-on: https://chromium-review.googlesource.com/1239641
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593601}
[modify] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/BUILD.gn
[modify] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h
[modify] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm
[rename] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_ns_view_client_helper.h
[add] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_ns_view_client_helper.mm
[modify] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_view_cocoa.h
[modify] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_view_cocoa.mm
[modify] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/5531909177b9231012cdac83a497ee94ee0af0e8/content/browser/renderer_host/render_widget_host_view_mac.mm

Project Member

Comment 41 by bugdroid1@chromium.org, Sep 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6c37e93444b733e0b464d61868ae67059ea702b7

commit 6c37e93444b733e0b464d61868ae67059ea702b7
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 25 03:41:04 2018

RemoteMacViews: Move sources to views_bridge_mac component

The views_bridge_mac directory contains the Cocoa front-end of the
macOS implementation of the views framework.

Start moving sources from ui/views/cocoa that have no dependencies
on ui/views over to this component.

Eventually the app shim process on macOS will only require this
component (and views will exist entirely in the browser process).

Bug:  821651 
Change-Id: I215acfa0620154771cd039fe593d43fb068d51cb
Reviewed-on: https://chromium-review.googlesource.com/1241199
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593816}
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/BUILD.gn
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/bridge_factory_impl.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/cocoa_mouse_capture_unittest.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/cocoa/views_nswindow_delegate.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views_bridge_mac/BUILD.gn
[modify] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views_bridge_mac/DEPS
[rename] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views_bridge_mac/bridged_native_widget_host_helper.h
[rename] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views_bridge_mac/cocoa_mouse_capture.h
[rename] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views_bridge_mac/cocoa_mouse_capture.mm
[rename] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views_bridge_mac/cocoa_mouse_capture_delegate.h
[add] https://crrev.com/6c37e93444b733e0b464d61868ae67059ea702b7/ui/views_bridge_mac/views_bridge_mac_export.h

Project Member

Comment 42 by bugdroid1@chromium.org, Sep 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f07f828e58ecb6b956266aae541c3c875793a894

commit f07f828e58ecb6b956266aae541c3c875793a894
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Sep 28 05:11:32 2018

RemoteRWHVMac: Instantiate content::NSViewBridgeFactoryImpl in app shim

Add to chrome::mojom::AppShim a CreateContentNSViewBridgeFactory
method. This will instantiate a content::NSViewBridgeFactoryImpl.

The caller of this method (AppShimHost, in the browser), creates
a content::NSViewBridgeFactoryHost to manage this interface. This
may be used (e.g, by content::RenderWidgetHostViewMac::
MigrateNSViewBridge), to create NSViews in an app shim process.

Add content/browser as a dependency of app_shim.

R=dominickn
TBR=avi

Bug:  821651 
Change-Id: Ice2b46f2d75a9725f5e8e8ad7d2c05e3d70b18eb
Reviewed-on: https://chromium-review.googlesource.com/1240154
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594987}
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/app_shim/BUILD.gn
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/app_shim/DEPS
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/app_shim/chrome_main_app_mode_mac.mm
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/browser/apps/app_shim/app_shim_host_mac.cc
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/browser/apps/app_shim/app_shim_host_mac.h
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/browser/apps/app_shim/app_shim_host_manager_browsertest_mac.mm
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/chrome/common/mac/app_shim.mojom
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/ui/views/cocoa/bridge_factory_host.cc
[modify] https://crrev.com/f07f828e58ecb6b956266aae541c3c875793a894/ui/views/cocoa/bridge_factory_host.h

Project Member

Comment 43 by bugdroid1@chromium.org, Oct 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a

commit 2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Oct 02 07:02:40 2018

RemoteMacViews: Add NSView handles

Add integer handles for NSViews that may be created in the app shim
process. This includes the BridgedNativeWidget content view and soon
will include the WebContentsView. A handle is not added for
RenderWidgetHostView because there are no planned methods that would
use it.

These handles will be needed for methods that require interactions
between NSViews created by different interfaces. Add as an example the
method RenderWidgetHostNSViewBridge::SetParentWebContentsNSView. This
will allow constructing the NSView hierarchy in the app shim process:
- BridgedNativeWidget
  - WebContentsView (coming in subsequent patches)
    - RenderWidgetHostView

Bug:  821651 
Change-Id: I225eb03f122baa9aea770d28e98a44c938943434
Reviewed-on: https://chromium-review.googlesource.com/1253094
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595746}
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/content/common/render_widget_host_ns_view.mojom
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/base/BUILD.gn
[add] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/base/cocoa/ns_view_ids.h
[add] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/base/cocoa/ns_view_ids.mm
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/views_bridge_mac/bridged_native_widget_impl.h
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/views_bridge_mac/bridged_native_widget_impl.mm
[modify] https://crrev.com/2f9fe77052ddd2d7583c5bdbd9491e8e9c82d06a/ui/views_bridge_mac/mojo/bridged_native_widget.mojom

Project Member

Comment 44 by bugdroid1@chromium.org, Oct 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b

commit ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Oct 02 07:45:00 2018

RemoteMacViews: Add mojo interface for WebContentsViewMac

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: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595751}
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/BUILD.gn
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/ns_view_bridge_factory_impl.mm
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/renderer_host/render_widget_host_view_mac.mm
[add] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/web_contents/web_contents_ns_view_bridge.h
[add] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/web_contents/web_contents_ns_view_bridge.mm
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/web_contents/web_contents_view_mac.h
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/browser/web_contents/web_contents_view_mac.mm
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/public/browser/ns_view_bridge_factory_impl.h
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/public/common/BUILD.gn
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/public/common/ns_view_bridge_factory.mojom
[add] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/content/public/common/web_contents_ns_view_bridge.mojom
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/ui/base/cocoa/views_hostable.h
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/ui/views/controls/native/native_view_host_mac.h
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/ui/views/controls/native/native_view_host_mac.mm
[modify] https://crrev.com/ed40bff25e4a7ce69629bc735dd1df5d9aff5f6b/ui/views/controls/native/native_view_host_mac_unittest.mm

Project Member

Comment 45 by bugdroid1@chromium.org, Oct 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/91abd984aee4c4d7251004798dd448e8de339257

commit 91abd984aee4c4d7251004798dd448e8de339257
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Oct 02 22:31:49 2018

RemoteMacViews: Make all mojo interfaces be associated

All mojo interfaces that manipulate NSViews need to be associated (for
example, adding an NSView as a child of another requires that the
parent NSView be in a known state -- each NSView has its own interface,
and so they all need to be associated to the same pipe).

Also change all bindings to use ui::WindowResizeHelperMac's task
runner. This task runner is used to pump a nested run loop inside
a Cocoa resize function (for smooth resize). All bindings on the same
associated connection need to use that task runner (otherwise, all
messages will be blocked behind any un-handled message).

Change BridgeFactoryHost to not assign a new host id, but take one
in the constructor (just because the logic is easier to follow that
way).

R=domonickn
TBR=avi (for content/ OWNERship)

Bug:  821651 
Change-Id: Ifb6aff292187b340d144d29ffe1258bb8d501267
Reviewed-on: https://chromium-review.googlesource.com/c/1253561
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596013}
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/chrome/app_shim/chrome_main_app_mode_mac.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/chrome/browser/apps/app_shim/app_shim_host_mac.cc
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/chrome/browser/apps/app_shim/app_shim_host_manager_browsertest_mac.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/chrome/common/mac/app_shim.mojom
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/content/browser/ns_view_bridge_factory_impl.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/content/browser/web_contents/web_contents_ns_view_bridge.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views/cocoa/bridge_factory_host.cc
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views/cocoa/bridge_factory_host.h
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views_bridge_mac/bridge_factory_impl.h
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views_bridge_mac/bridge_factory_impl.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views_bridge_mac/bridged_native_widget_impl.h
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views_bridge_mac/bridged_native_widget_impl.mm
[modify] https://crrev.com/91abd984aee4c4d7251004798dd448e8de339257/ui/views_bridge_mac/mojo/bridge_factory.mojom

Status: Fixed (was: Assigned)
Marking this as done. I'll be filing more targeted bugs off of issue 859152.
\o/

Sign in to add a comment