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

Issue 859152 link

Starred by 49 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug


Sign in to add a comment

Host MacViews in AppShim process

Project Member Reported by ccameron@chromium.org, Jun 29 2018

Issue description

This is in the context of shipping PWAs on macOS:
https://docs.google.com/document/d/19uYpKzWwBApHLdmUqjgNF0CDgR0WcsMaE9tfnh8NNPU/edit?usp=sharing

The plan is to slice BridgedNativeWidget into parts that run in the browser process and parts that can run in the app shim process.

A rough guide to the surgery is here:
https://docs.google.com/document/d/1Cym6LpmrYZU6Jl1BYKhuWqzRJV_OL8LYYepGGAJw7oE/edit?usp=sharing
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 2

Cc: tapted@chromium.org
I'm going to start with the easier parts here -- in the first patches I'll be
- creating a BridgedNativeWidgetClient interface
- using that client interface BridgedContentView instead of
  - hostedView_ and
  - textInputClient_

Cc: ccameron@chromium.org sdy@chromium.org
 Issue 825267  has been merged into this issue.
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 7

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

commit 83e3b96c60f0d664ad50460086902130854118d7
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Aug 07 06:07:04 2018

RemoteMacViews: Add BridgedNativeWidgetHost[Impl]

Add an empty BridgedNativeWidgetHost interface and a largely-empty
BridgedNativeWidgetHostImpl implementation. These will be the browser
process part of BridgedNativeWidget.

Update NativeWidgetMac to have a BridgedNativeWidgetHost instead of a
BridgedNativeWidget, but still allow calls through the old interface.

The next steps will be a long process of shuffling members and methods
to these interfaces.

Bug: 859152
Change-Id: Id8be908302a32e52dc0ae1bf54fe19a285adccef
Reviewed-on: https://chromium-review.googlesource.com/1162875
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581146}
[modify] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/BUILD.gn
[add] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/cocoa/bridged_native_widget_host.h
[add] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/cocoa/bridged_native_widget_host_impl.h
[add] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm
[modify] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/83e3b96c60f0d664ad50460086902130854118d7/ui/views/widget/native_widget_mac.mm

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 8

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

commit 43bd10a260d1b8fe55df71087cec315c4a9c7878
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Aug 08 22:27:55 2018

Remote MacViews: Move ui::Compositor to browser

Move the following from BridgedNativeWidget to
BridgedNativeWidgetHostImpl:
- ui::Compositor (as RecyclableCompositorMac)
- ui::LayerDelegate subclass
- ui::LayerOwner subclass
- ui::AcceleratedWidgetMacNSView subclass

Update BridgedNativeWidgetHost interface to include methods to
indicate the desired size and visibility of the ui::Compositor.

Add methods to BridgedNativeWidget which will in the future be
transferred to the abstract interface (when BridgedNativeWidget is
renamed to BridgedNativeWidgetImpl, which I'm still putting off for
merge-ability sake).
- OnCompositorCreated indicates that the compositor is created and
  should receive size and visibility updates
- SetCALayerParams sends the parameters needed to display the
  compositor contents in another process

Bug: 859152
Change-Id: I62209be44035f6b2b596afeb827cd951f30ef40c
Reviewed-on: https://chromium-review.googlesource.com/1166196
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581709}
[modify] https://crrev.com/43bd10a260d1b8fe55df71087cec315c4a9c7878/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/43bd10a260d1b8fe55df71087cec315c4a9c7878/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/43bd10a260d1b8fe55df71087cec315c4a9c7878/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/43bd10a260d1b8fe55df71087cec315c4a9c7878/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/43bd10a260d1b8fe55df71087cec315c4a9c7878/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/43bd10a260d1b8fe55df71087cec315c4a9c7878/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/43bd10a260d1b8fe55df71087cec315c4a9c7878/ui/views/widget/native_widget_mac_unittest.mm

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 9

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

commit ab8d97812726d0635144b97caaa2f4161345b810
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Aug 09 23:43:19 2018

RemoteMacViews: Remove most views calls from BridgedContentView

In BridgedContentView, change most calls that refer to the views::View
hostedView_ to be routed through the BridgedNativeWidgetHost interface.

Leave keyboard events, text input, and a11y unchanged for now.

Add a BridgedNativeWidgetHostImpl::SetRootLayer method which now calls
through to BridgedNativeWidget::SetRootLayer. Once the remaining uses
of hostedView_ are removed, the BridgedNativeWidget::SetRootLayer method
will be removed.

Bug: 859152
Change-Id: I2a010b3149357af4f9aeaec0088eb9fcde53db13
Reviewed-on: https://chromium-review.googlesource.com/1168459
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581960}
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/cocoa/bridged_content_view.h
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/ab8d97812726d0635144b97caaa2f4161345b810/ui/views/widget/native_widget_mac.mm

Project Member

Comment 7 by bugdroid1@chromium.org, Aug 10

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

commit 1bd4c1f47351bb5e0bb634f97918bf5af5d6476a
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Aug 10 17:53:38 2018

RemoteMacViews: Move FocusChangeListener and InputMethodDelegate

Move the interfaces FocusChangeListener and InputMethodDelegate from
being implemented by BridgedNativeWidget to being implemented in
BridgedNativeWidgetHostImpl. This has the effect of moving them from
the app shim process to the browser process.

This is in preparaton for removing access to TextInputClient from
BridgedContentView (that operation is delicate). Add a temporary
method on BridgedNativeWidget to set the TextInputClient for
BridgedContentView from BridgedNativeWidgetHostImpl (where we now
receive the OnDidChangeFocus notification).

Bug: 859152
Change-Id: I1f5639448cc9f7b4b00058444ab64914b9193df3
Reviewed-on: https://chromium-review.googlesource.com/1170582
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582238}
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/test/widget_test_mac.mm
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/1bd4c1f47351bb5e0bb634f97918bf5af5d6476a/ui/views/widget/native_widget_mac.mm

Project Member

Comment 8 by bugdroid1@chromium.org, Aug 15

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

commit 9af971cc8402bf7fe79fe49f6bde36c03a971187
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Aug 15 19:12:15 2018

RemoteMacViews: Allow for BridgedNativeWidget to create its own NSWindow

Because BridgedNativeWidget will be living in its own process, it will
be necessary for BridgedNativeWidget to create its own NSWindow, instead
of having one be provided during initialization.

This requires substantial refactoring, and two of the NSWindow classes
that BridgedNativeWidget are provided live in chrome/browser/ui, and
will need moving to a new location.

For the moment, allow either creating a new NSWindow or specifying an
NSWindow via the methods BridgedNativeWidget::CreateWindow and
BridgedNativeWidget::SetWindow. This unblocks cross-process development.

Also, be explicit that BridgedNativeWidget's NSWindow is always a
NativeWidgetMacNSWindow or a sub-class thereof. The only exceptions to
this are in tests, so merge testing functionality into
NativeWidgetMacNSWindow.

Bug: 859152
Change-Id: I61edb34d773fc11dff921da5edb34da1e306105b
Reviewed-on: https://chromium-review.googlesource.com/1175051
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583350}
[modify] https://crrev.com/9af971cc8402bf7fe79fe49f6bde36c03a971187/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/9af971cc8402bf7fe79fe49f6bde36c03a971187/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/9af971cc8402bf7fe79fe49f6bde36c03a971187/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/9af971cc8402bf7fe79fe49f6bde36c03a971187/ui/views/cocoa/native_widget_mac_nswindow.h
[modify] https://crrev.com/9af971cc8402bf7fe79fe49f6bde36c03a971187/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/9af971cc8402bf7fe79fe49f6bde36c03a971187/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/9af971cc8402bf7fe79fe49f6bde36c03a971187/ui/views/widget/native_widget_mac_unittest.mm

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 18

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

commit 78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e
Author: Christopher Cameron <ccameron@chromium.org>
Date: Sat Aug 18 06:47:18 2018

RemoteMacViews: Push window size and display properties

The methods NativeWidgetMac::GetWindowBoundsInScreen,
GetClientAreaBoundsInScreen, and GetWorkAreaBoundsInScreen compute
their results by querying the underlying NSWindow.

When the NSWindow is a separate process, this won't be an option.
Instead, have the BridgedNativeWidget push these properties to the
BridgetNativeWidgetHost, from which the NativeWidgetMac may query them.

Also have the BridgedNativeWidget (in the app shim process) query the
display::Display for its NSWindow and send that to the
BridgetNativeWidgetHost (in the browser process). This can then be
used to update the device scale factor, vsync, and color space
properties of the compositor (at present these properties updated only
by attached RenderWidgetHostViewMacs).

Rename BridgedNativeWidgetHost::SetSize to SetViewSize, to indicate
that it is computed differently.

Remove BridgedNativeWidgetHost::SetCompositorSize as its functionality
can be rolled into the new function.

Bug: 859152
Change-Id: If00184c31f9c493ece4ea08ace11d0be3a866786
Reviewed-on: https://chromium-review.googlesource.com/1175428
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584308}
[modify] https://crrev.com/78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/78a0d81fb18f78c01c6b2b3908c9e4f4d13dc97e/ui/views/widget/native_widget_mac.mm

Project Member

Comment 10 by bugdroid1@chromium.org, Aug 18

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

commit 740a6c4c4d2af5891355c5b4e736094808cc87c8
Author: Christopher Cameron <ccameron@chromium.org>
Date: Sat Aug 18 22:28:04 2018

RemoteMacViews: Re-separate test code

This removes parts of crrev.com/583350, preserving the following
- explicitly require that NSWindows be NativeWidgetMacNSWindow
- return a scoped_nsobject from CreateNSWindow, and remove requirement
  of autoreleasing the result, to clarify lifetimes

This removes the ability to create an NSWindow in the AppShim process
for now. That will be re-added later.

Bug: 859152
Change-Id: Ife70a91ac9557f2ec7a488a8714f907eaecea0e3
Reviewed-on: https://chromium-review.googlesource.com/1177276
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584323}
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/chrome/browser/ui/views/apps/app_window_native_widget_mac.h
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/chrome/browser/ui/views/apps/app_window_native_widget_mac.mm
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/chrome/browser/ui/views/frame/browser_frame_mac.h
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/chrome/browser/ui/views/frame/browser_frame_mac.mm
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/cocoa/native_widget_mac_nswindow.h
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/740a6c4c4d2af5891355c5b4e736094808cc87c8/ui/views/widget/native_widget_mac_unittest.mm

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 19

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

commit 5f99a2c05d61a2782970f6091b744b6092885db0
Author: Christopher Cameron <ccameron@chromium.org>
Date: Sun Aug 19 01:09:42 2018

RemoteMacViews: Remove browser dependencies of SetBounds

The function BridgedNativeWidget::SetBounds calls back into the
NativeWidgetMac to determine
- the minimum content size
- if the widget's position should be relative to the parent or the
  screen (and the offset to do that computation)
- if the widget is a modal sheet
This call will eventually be running in the app shim process, where
these values will not be available (without adding a synchronous IPC).

Change NativeWidgetMac::SetBounds to call BridgedNativeWidgetHostImpl::
SetBounds, and have that function pre-compute the required parameters,
- minimum content size
- offset necessary to be applied to compensate for position being
  relative to the parent or the screen
- (but not if the widget is a modal sheet, that's coming later)
and pass these as parameters to BridgedNativeWidget::SetBounds.

Split out the SetBounds calls made during initialization from
being within BridgedNativeWidget::Init to being made by its caller,
BridgedNativeWidgetHostImpl::InitWindow, to allow the additional
parameters to be passed in.

Bug: 859152
Change-Id: I2f33ab08f60d2ed1bc3b6af5ecf3402e3715ffd4
Reviewed-on: https://chromium-review.googlesource.com/1178813
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584327}
[modify] https://crrev.com/5f99a2c05d61a2782970f6091b744b6092885db0/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/5f99a2c05d61a2782970f6091b744b6092885db0/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/5f99a2c05d61a2782970f6091b744b6092885db0/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/5f99a2c05d61a2782970f6091b744b6092885db0/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/5f99a2c05d61a2782970f6091b744b6092885db0/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/5f99a2c05d61a2782970f6091b744b6092885db0/ui/views/widget/native_widget_mac.mm

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 19

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

commit 6789bf06061718653a257ecf08ab12e08a503d2f
Author: Nico Weber <thakis@chromium.org>
Date: Sun Aug 19 18:03:28 2018

Revert "RemoteMacViews: Remove browser dependencies of SetBounds"

This reverts commit 5f99a2c05d61a2782970f6091b744b6092885db0.

Reason for revert: WebDialogBrowserTest.SizeWindow fails on max 10.11, 10.12 (10.10 and 10.13 seem happy):

https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.11%20Tests/28636
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.12%20Tests/14984

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

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

Change-Id: I1300db812416881fb539b586e7d7fab2597d60c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 859152
Reviewed-on: https://chromium-review.googlesource.com/1180761
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584339}
[modify] https://crrev.com/6789bf06061718653a257ecf08ab12e08a503d2f/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/6789bf06061718653a257ecf08ab12e08a503d2f/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/6789bf06061718653a257ecf08ab12e08a503d2f/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/6789bf06061718653a257ecf08ab12e08a503d2f/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/6789bf06061718653a257ecf08ab12e08a503d2f/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/6789bf06061718653a257ecf08ab12e08a503d2f/ui/views/widget/native_widget_mac.mm

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 19

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

commit e33fda00811b2fde69f435d74af225e83e8f0f30
Author: Nico Weber <thakis@chromium.org>
Date: Sun Aug 19 18:05:28 2018

Revert "RemoteMacViews: Re-separate test code"

This reverts commit 740a6c4c4d2af5891355c5b4e736094808cc87c8.

Reason for revert: views_unittests WidgetTest.FullscreenStatePropagated ,
WidgetTest.FullscreenStatePropagated_DesktopWidget consistently started failing on 10.10 (other versions seem happy):

https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.10%20Tests/34348

Original change's description:
> RemoteMacViews: Re-separate test code
> 
> This removes parts of crrev.com/583350, preserving the following
> - explicitly require that NSWindows be NativeWidgetMacNSWindow
> - return a scoped_nsobject from CreateNSWindow, and remove requirement
>   of autoreleasing the result, to clarify lifetimes
> 
> This removes the ability to create an NSWindow in the AppShim process
> for now. That will be re-added later.
> 
> Bug: 859152
> Change-Id: Ife70a91ac9557f2ec7a488a8714f907eaecea0e3
> Reviewed-on: https://chromium-review.googlesource.com/1177276
> Commit-Queue: ccameron <ccameron@chromium.org>
> Reviewed-by: Trent Apted <tapted@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#584323}

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

Change-Id: I9c16deb13126c51171bdd180200025cbcf808a03
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 859152
Reviewed-on: https://chromium-review.googlesource.com/1180762
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584340}
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/chrome/browser/ui/views/apps/app_window_native_widget_mac.h
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/chrome/browser/ui/views/apps/app_window_native_widget_mac.mm
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/chrome/browser/ui/views/frame/browser_frame_mac.h
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/chrome/browser/ui/views/frame/browser_frame_mac.mm
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/cocoa/native_widget_mac_nswindow.h
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/e33fda00811b2fde69f435d74af225e83e8f0f30/ui/views/widget/native_widget_mac_unittest.mm

Project Member

Comment 14 by bugdroid1@chromium.org, Aug 19

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

commit 79550cc421eef94fc892e40d26b22f6298e4ee01
Author: Christopher Cameron <ccameron@chromium.org>
Date: Sun Aug 19 22:10:41 2018

RemoteMacViews: Re-separate test code

This removes parts of crrev.com/583350, preserving the following
- explicitly require that NSWindows be NativeWidgetMacNSWindow

This removes the ability to create an NSWindow in the AppShim process
for now. That will be re-added later.

This is a re-land of crrev.com/584323 (reverted in crrev.com/584323),
with the changes in lifetime management (use of autorelease) removed,
because it appears that tests make assumptions about lifetime. Added
a comment about this.

TBR=tapted

Bug: 859152
Change-Id: Ia0e2811c903316a0c1ed07be6cd7275bb8cf421d
Reviewed-on: https://chromium-review.googlesource.com/1180707
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584344}
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/cocoa/native_widget_mac_nswindow.h
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/79550cc421eef94fc892e40d26b22f6298e4ee01/ui/views/widget/native_widget_mac_unittest.mm

Project Member

Comment 15 by bugdroid1@chromium.org, Aug 20

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

commit cd4d9d7f944602dced052711f6d05a0e25c0eb89
Author: Christopher Cameron <ccameron@chromium.org>
Date: Mon Aug 20 05:13:19 2018

RemoteMacViews: Remove browser dependencies of SetBounds

The function BridgedNativeWidget::SetBounds calls back into the
NativeWidgetMac to determine
- the minimum content size
- if the widget's position should be relative to the parent or the
  screen (and the offset to do that computation)
- if the widget is a modal sheet
This call will eventually be running in the app shim process, where
these values will not be available (without adding a synchronous IPC).

Change NativeWidgetMac::SetBounds to call BridgedNativeWidgetHostImpl::
SetBounds, and have that function pre-compute the required parameters,
- minimum content size
- offset necessary to be applied to compensate for position being
  relative to the parent or the screen
- (but not if the widget is a modal sheet, that's coming later)
and pass these as parameters to BridgedNativeWidget::SetBounds.

Split out the SetBounds calls made during initialization from
being within BridgedNativeWidget::Init to being made by its caller,
BridgedNativeWidgetHostImpl::InitWindow, to allow the additional
parameters to be passed in.

This is a re-land of crrev.com/584327 (reverted in crrev.com/584339)
with the logic for initial bounds setting separated out into the
BridgedNativeWidget::SetInitialBounds (merging the behaviors was too
ambitious).

TBR=ellyjones (original reviewer)

Bug: 859152
Change-Id: I98b6a5d419e586fb2697ef3b45fdc19c73f9c619
Reviewed-on: https://chromium-review.googlesource.com/1180715
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584363}
[modify] https://crrev.com/cd4d9d7f944602dced052711f6d05a0e25c0eb89/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/cd4d9d7f944602dced052711f6d05a0e25c0eb89/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/cd4d9d7f944602dced052711f6d05a0e25c0eb89/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/cd4d9d7f944602dced052711f6d05a0e25c0eb89/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/cd4d9d7f944602dced052711f6d05a0e25c0eb89/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/cd4d9d7f944602dced052711f6d05a0e25c0eb89/ui/views/widget/native_widget_mac.mm

Project Member

Comment 16 by bugdroid1@chromium.org, Aug 21

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

commit c6995dcb7a70cfd044621c4fead710ef809f5945
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Aug 21 17:16:25 2018

RemoteMacViews: Separate fullscreen state

Make NativeWidgetMac::SetFullscreen go through
BridgedNativeWidgetHostImpl instead of directly manipulating
BridgedNativeWidget. Make note of subtle state tracking behavior in
BridgedNativeWidgetHostImpl::SetFullscreen.

Change BridgedNativeWidget's fullscreen transition functions to go
through the BridgedNativeWidgetHost interface instead of calling into
NativeWidgetMac directly.

Move tracking for GetBoundsForRestore from BridgedNativeWidget to
BridgedNativeWidgetHostImpl.

Change BridgedNativeWidget from pulling size constraints in
BridgedNativeWidget::OnSizeConstraintsChanged to having the
NativeWidgetMac push these constraints to BridgedNativeWidget.

Bug: 859152
Change-Id: Ie33b79becf1ccd1d476e8033cb078d0ffe75463f
Reviewed-on: https://chromium-review.googlesource.com/1182673
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584804}
[modify] https://crrev.com/c6995dcb7a70cfd044621c4fead710ef809f5945/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/c6995dcb7a70cfd044621c4fead710ef809f5945/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/c6995dcb7a70cfd044621c4fead710ef809f5945/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/c6995dcb7a70cfd044621c4fead710ef809f5945/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/c6995dcb7a70cfd044621c4fead710ef809f5945/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/c6995dcb7a70cfd044621c4fead710ef809f5945/ui/views/widget/native_widget_mac.mm

Project Member

Comment 17 by bugdroid1@chromium.org, Aug 21

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

commit 188c284eb418b4f72bfd38b9dfd64a8b9147df44
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Aug 21 17:23:10 2018

RemoteMacViews: Update visibility, miniaturize, and key window state

Mechanically move the following functions either from
BridgedNativeWidget to BridgedNativeWidgetPublic or from direct
manipulation in NativeWidgetMac to BridgedNativeWidgetPublic:
  - SetVisibilityState
  - SetVisibleOnAllSpaces
  - SetMiniaturized
  - SetOpacity
  - SetContentAspectRatio
  - SetWindowTitle
  - MakeFirstResponder

Add state tracking for visibility, miniaturization, and window key
status to BridgedNativeWidgetHostImpl.

Merge the new visibility tracking in with the existing compositor
visibility tracking.

Bug: 859152
Change-Id: I750986e6732bc54ff12e90a75e9d649a34895682
Reviewed-on: https://chromium-review.googlesource.com/1182962
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584811}
[modify] https://crrev.com/188c284eb418b4f72bfd38b9dfd64a8b9147df44/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/188c284eb418b4f72bfd38b9dfd64a8b9147df44/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/188c284eb418b4f72bfd38b9dfd64a8b9147df44/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/188c284eb418b4f72bfd38b9dfd64a8b9147df44/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/188c284eb418b4f72bfd38b9dfd64a8b9147df44/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/188c284eb418b4f72bfd38b9dfd64a8b9147df44/ui/views/cocoa/views_nswindow_delegate.mm
[modify] https://crrev.com/188c284eb418b4f72bfd38b9dfd64a8b9147df44/ui/views/widget/native_widget_mac.mm

Project Member

Comment 18 by bugdroid1@chromium.org, Aug 27

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

commit b606180d4b63df83a5770dc93dd000962c9a18f3
Author: Christopher Cameron <ccameron@chromium.org>
Date: Mon Aug 27 20:22:58 2018

RemoteMacViews: Separate MouseCapture interface

Add methods mouse capture methods to the BridgedNativeWidgetPublic
interface that BridgedNativeWidget implements.

Have BridgedNativeWidget pass the mouse capture status to
BridgedNativeWidgetHostImpl, which the NativeWidgetMac will access.

Add NativeWidgetMac::GetBridgeHostImplForNativeWindow method for
unittests, and merge the implementations of GetBridgeForNativeWindow,
GetBridgeHostImplForNativeWindow, and GetNativeWidgetForNativeWindow.

Bug: 859152
Change-Id: I25af661ad487b4f5a89bb02b1c655fb0ab27b8fb
Reviewed-on: https://chromium-review.googlesource.com/1186161
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586392}
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/cocoa/drag_drop_client_mac_unittest.mm
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/b606180d4b63df83a5770dc93dd000962c9a18f3/ui/views/widget/native_widget_mac.mm

Project Member

Comment 19 by bugdroid1@chromium.org, Aug 27

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

commit e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a
Author: Christopher Cameron <ccameron@chromium.org>
Date: Mon Aug 27 23:40:28 2018

RemoteMacViews: Separate window initialization and closing

Move BridgedNativeWidget::Init to no longer take Widget::InitParams,
and instead take a new BridgedNativeWidget::InitParams. The translation
of these parameters is in BridgedNativeWidgetHostImpl::InitWindow.

In part of this translation, make setting the parent NSView be a
separate function, BridgedNativeWidget::SetParent. Change
ReparentNativeView to use this same SetParent function, and add a few
comments about possibly missed edge cases (ReparentNativeView appears
not to be called in production).

Move closing the window from having its Cocoa calls be in
NativeWidgetMac to being in BridgedNativeWidget. As part of this,
change BridgedNativeWidget::SetRootView to be two separate functions,
CreateContentView and DestroyContentView.

Move the function IsWindowModalSheet from NativeWidgetMac over to
BridgedNativeWidget, and capture (during initialization) the state
required for the function.

Bug: 859152
Change-Id: I1e2bd45b814835070ba10066618ed9c2e16aa304
Reviewed-on: https://chromium-review.googlesource.com/1188065
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586494}
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/e0d2426a3033457457a0c19a3f9a6cba0cdc6e4a/ui/views/widget/native_widget_mac.mm

Project Member

Comment 20 by bugdroid1@chromium.org, Aug 28

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

commit 44e243b1db27953a18e00dad9eded3a2d52f0e4c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Aug 28 21:55:14 2018

RemoteMacViews: Remove use of views from touchbar

Change BridgedContentView(TouchBarAdditions) to no longer directly
call into the hostedView_ member (a views::View) directly, and
route these calls through the BridgedNativeWidgetHost interface
(which will be mojo-ified).

Bug: 859152
Change-Id: I016ed2ead343e5d66900e9fc01441b77439d0208
Reviewed-on: https://chromium-review.googlesource.com/1192546
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586870}
[modify] https://crrev.com/44e243b1db27953a18e00dad9eded3a2d52f0e4c/ui/views/cocoa/bridged_content_view_touch_bar.mm
[modify] https://crrev.com/44e243b1db27953a18e00dad9eded3a2d52f0e4c/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/44e243b1db27953a18e00dad9eded3a2d52f0e4c/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/44e243b1db27953a18e00dad9eded3a2d52f0e4c/ui/views/cocoa/bridged_native_widget_host_impl.mm

Project Member

Comment 21 by bugdroid1@chromium.org, Aug 29

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

commit 372a2ea4d9f0f795df78abe5d9bc66203cf924d9
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Aug 29 17:40:47 2018

RemoteMacViews: Handle key and menu events via BridgedNativeWidgetHost

Route calls to handle keyboard events through BridgedNativeWidgetHost,
instead of calling into the views::View, which will exist only in the
browser process. The event handling functions need to "know" if the
event was handled, so make the calls synchronous and return whether or
not the event was handled.

Add similar routing for menu dispatching.

Also add the method GetIsFocusedViewTextual to BridgedNativeWidgetHost,
since it is nearby and similar.

Bug: 859152
Change-Id: I67b21dbd736fc4ccbb5c5216707dd3a1667d6ef5
Reviewed-on: https://chromium-review.googlesource.com/1192267
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587183}
[modify] https://crrev.com/372a2ea4d9f0f795df78abe5d9bc66203cf924d9/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/372a2ea4d9f0f795df78abe5d9bc66203cf924d9/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/372a2ea4d9f0f795df78abe5d9bc66203cf924d9/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/372a2ea4d9f0f795df78abe5d9bc66203cf924d9/ui/views/cocoa/bridged_native_widget_host_impl.mm

Project Member

Comment 22 by bugdroid1@chromium.org, Aug 29

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

commit 59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Aug 29 19:04:53 2018

RemoteMacViews: Remove all use of views APIs from BridgedContentView

In previous patches, we have routed almost all usage of the views
APIs in BridgedContentView to go through the BridgedNativeWidgetHost.
This completes this process.

Change initialization of BridgedContentView to not take a views::View,
and instead take the initial bounds (which were previously the only
thing read from the views::View).

Move the functions CreateContentView and DestroyContentView to the
public interface. Add a new non-public function, CreateDragDropClient,
because drag-drop behavior has not been routed through mojo-ifiable
interfaces yet.

Add an accessor to BridgedNativeWidget to query whether or not the
window is translucent (which was previously determined by querying
properties of the ui::Layer).

Bug: 859152
Change-Id: Iaa5b628f619fc35a48530812c15d0cc877a3d40c
Reviewed-on: https://chromium-review.googlesource.com/1192547
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587228}
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_content_view.h
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/59b9c0bbe9eac3adbf636b0ebd29d32cbe8bf162/ui/views/widget/native_widget_mac.mm

Project Member

Comment 23 by bugdroid1@chromium.org, Aug 30

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

commit 7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Aug 30 21:25:08 2018

RemoteMacViews: Mojo-ify BridgedNativeWidget interface

Create a new component //ui/views_bridge_mac for the Cocoa parts of the
Cocoa implementation of views.

Move the interface views::BridgedNativeWidgetPublic from being a C++
pure virtual interface to the mojo interface BridgedNativeWidget in
views_bridge_mac. Note that the concrete implementation of this
interface, views::BridgedNativeWidget is to be renamed to
BridgedNativeWidgetImpl, and moved to cocoa_viewer.

Bug: 859152
Change-Id: I3d97502285e81d603948672e9789366cd09d6b3d
Reviewed-on: https://chromium-review.googlesource.com/1194498
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587772}
[modify] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views/BUILD.gn
[modify] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views/cocoa/DEPS
[modify] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views/widget/native_widget_mac.mm
[add] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views_bridge_mac/BUILD.gn
[add] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views_bridge_mac/DEPS
[add] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views_bridge_mac/OWNERS
[add] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views_bridge_mac/README.md
[add] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views_bridge_mac/mojo/OWNERS
[add] https://crrev.com/7c50328d19fa768ac1a98f1c3cca4a21f3c7c56a/ui/views_bridge_mac/mojo/bridged_native_widget.mojom

Project Member

Comment 24 by bugdroid1@chromium.org, Aug 31

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

commit 5ff407e19569ad407ad37bddce803759be206e69
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Aug 31 20:16:18 2018

RemoteMacViews: Mojo-ify BridgedNativeWidgetHost

Take the existing BridgedNativeWidgetHost and break it into two parts
- a mojo interface views_bridge_mac::mojo::BridgedNativeWidgetHost
- a helper and "stuff we haven't mojo-ified-yet" interface
  BridgedNativeWidgetHostHelper
  - this is not named BridgedNativeWidgetHost to avoid conflicts
  - this will be moved to //ui/views_bridge_mac soon (build is tangled)

Add mojo support for ui::DialogButton, because it's used by this
interface.

For keyboard event handling, use the BridgedNativeWidgetHostHelper
interface because a mojo-compatible interface would be hard for the
callers to use.

Bug: 859152
Change-Id: If6802ab4d6e518184cd3fa57eef5d8a510b80e59
Reviewed-on: https://chromium-review.googlesource.com/1198014
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588144}
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/base/mojo/ui_base_types.mojom
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/base/mojo/ui_base_types.typemap
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/base/mojo/ui_base_types_struct_traits.h
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/bridged_content_view_touch_bar.mm
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views/cocoa/views_nswindow_delegate.mm
[modify] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views_bridge_mac/BUILD.gn
[add] https://crrev.com/5ff407e19569ad407ad37bddce803759be206e69/ui/views_bridge_mac/mojo/bridged_native_widget_host.mojom

Project Member

Comment 25 by bugdroid1@chromium.org, Sep 6

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

commit fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Sep 06 20:09:28 2018

RemoteMacViews: Move tooltip manager to browser side

Move TooltipManager from BridgedNativeWidget (in the app shim side)
to BridgedNativeWidgetHost (in the browser side). Change the one
method in TooltipManagerMac that interacted with Cocoa to go through
mojo instead.

This is necessary to ensure that NativeWidgetMac::GetTooltipManager
works when NativeWidgetMac (in the browser) does not have direct
access to BridgedNativeWidgetImpl (in the app shim).

Bug: 859152
Change-Id: I46ceeeed8e18f3fab35ace5664bb17ceff5da40c
Reviewed-on: https://chromium-review.googlesource.com/1205496
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589260}
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views/cocoa/tooltip_manager_mac.h
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views/cocoa/tooltip_manager_mac.mm
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/fd8e8380cb6e1ac3f44c7d8e61c3b5c247a722f9/ui/views_bridge_mac/mojo/bridged_native_widget.mojom

Project Member

Comment 26 by bugdroid1@chromium.org, Sep 7

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

commit f33346413cacbaa55e303cea029e9c6a19d6d254
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Sep 07 02:33:37 2018

RemoteMacViews: Remove browser deps from NativeWidgetMacNSWindow

Update NativeWidgetMacNSWindow to use the mojo BridgeNativeWidgetHost
interface instead of directly dereferencing views structures. Make
similar changes to ViewsNSWindowDelegate. Update the mojo interfaces
to include these functions.

Remove the nativeWidgetMac property from ViewsNSWindowDelegate.
Replace it with an "id" uint64_t on NativeWidgetMacNSWindow, which
can be used to look up a corresponding
- BridgedNativeWidgetImpl (in the app/viewer process)
- BridgedNativeWidgetHostImpl (in the browser process)
  - a follow-on patch will add a "shadow" NativeWidgetMacNSWindow
    in the browser process which will use this id
  - that window will not be visible, but will be used for state
    tracking and bounds computations

Bug: 859152
Change-Id: I9f62aefa1d4eba9961f691b5bd9247871e121355
Reviewed-on: https://chromium-review.googlesource.com/1205477
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589415}
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/native_widget_mac_nswindow.h
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/views_nswindow_delegate.h
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/cocoa/views_nswindow_delegate.mm
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/f33346413cacbaa55e303cea029e9c6a19d6d254/ui/views_bridge_mac/mojo/bridged_native_widget_host.mojom

Project Member

Comment 27 by bugdroid1@chromium.org, Sep 7

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

commit 41aadb51b0a88e70923eb998a7815fa14ea435aa
Author: Daniel Bratell <bratell@opera.com>
Date: Fri Sep 07 08:41:34 2018

[jumbo] Make it one g_id_map instead of two.

A commit just introduced a second g_id_map in ui/views/cocoa,
which broke jumbo builds. This renames the g_id_map
globals to the longer names g_id_to_impl_map and
g_id_to_host_impl_map.

Bug: 859152

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

Change-Id: Id30d71b67f4bfb7c3ddc3ec8d03c759b5b7df14f
Reviewed-on: https://chromium-review.googlesource.com/1212862
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#589465}
[modify] https://crrev.com/41aadb51b0a88e70923eb998a7815fa14ea435aa/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/41aadb51b0a88e70923eb998a7815fa14ea435aa/ui/views/cocoa/bridged_native_widget_host_impl.mm

Project Member

Comment 28 by bugdroid1@chromium.org, Sep 7

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

commit 821ebe6c946b5300ce259fc2211f120289060bc7
Author: Justin Donnelly <jdonnelly@chromium.org>
Date: Fri Sep 07 20:33:30 2018

Revert "[jumbo] Make it one g_id_map instead of two."

This reverts commit 41aadb51b0a88e70923eb998a7815fa14ea435aa.

Reason for revert: Introduces static initializers according to https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/mac-rel/552.

Original change's description:
> [jumbo] Make it one g_id_map instead of two.
> 
> A commit just introduced a second g_id_map in ui/views/cocoa,
> which broke jumbo builds. This renames the g_id_map
> globals to the longer names g_id_to_impl_map and
> g_id_to_host_impl_map.
> 
> Bug: 859152
> 
> TBR=ccameron@chromium.org,ellyjones@chromium.org
> 
> Change-Id: Id30d71b67f4bfb7c3ddc3ec8d03c759b5b7df14f
> Reviewed-on: https://chromium-review.googlesource.com/1212862
> Reviewed-by: Daniel Bratell <bratell@opera.com>
> Commit-Queue: Daniel Bratell <bratell@opera.com>
> Cr-Commit-Position: refs/heads/master@{#589465}

TBR=ellyjones@chromium.org,ccameron@chromium.org,bratell@opera.com

Change-Id: I70fdf14f4759f74e9572e0b69884febb2607adcc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 859152
Reviewed-on: https://chromium-review.googlesource.com/1213705
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589620}
[modify] https://crrev.com/821ebe6c946b5300ce259fc2211f120289060bc7/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/821ebe6c946b5300ce259fc2211f120289060bc7/ui/views/cocoa/bridged_native_widget_host_impl.mm

Project Member

Comment 29 by bugdroid1@chromium.org, Sep 9

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

commit 0efe91327305c351ec391ef81754933e115b62cd
Author: Justin Donnelly <jdonnelly@chromium.org>
Date: Sun Sep 09 02:52:54 2018

Revert "RemoteMacViews: Remove browser deps from NativeWidgetMacNSWindow"

This reverts commit f33346413cacbaa55e303cea029e9c6a19d6d254.

Reason for revert: Reason for revert: Introduces static initializers according to https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/mac-rel/549.

Original change's description:
> RemoteMacViews: Remove browser deps from NativeWidgetMacNSWindow
> 
> Update NativeWidgetMacNSWindow to use the mojo BridgeNativeWidgetHost
> interface instead of directly dereferencing views structures. Make
> similar changes to ViewsNSWindowDelegate. Update the mojo interfaces
> to include these functions.
> 
> Remove the nativeWidgetMac property from ViewsNSWindowDelegate.
> Replace it with an "id" uint64_t on NativeWidgetMacNSWindow, which
> can be used to look up a corresponding
> - BridgedNativeWidgetImpl (in the app/viewer process)
> - BridgedNativeWidgetHostImpl (in the browser process)
>   - a follow-on patch will add a "shadow" NativeWidgetMacNSWindow
>     in the browser process which will use this id
>   - that window will not be visible, but will be used for state
>     tracking and bounds computations
> 
> Bug: 859152
> Change-Id: I9f62aefa1d4eba9961f691b5bd9247871e121355
> Reviewed-on: https://chromium-review.googlesource.com/1205477
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Commit-Queue: ccameron <ccameron@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#589415}

TBR=ellyjones@chromium.org,ccameron@chromium.org,rsesek@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 859152
Change-Id: I597859c3dc3c11f231d21de73799c99481d28f36
Reviewed-on: https://chromium-review.googlesource.com/1214759
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589793}
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/native_widget_mac_nswindow.h
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/views_nswindow_delegate.h
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/cocoa/views_nswindow_delegate.mm
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/0efe91327305c351ec391ef81754933e115b62cd/ui/views_bridge_mac/mojo/bridged_native_widget_host.mojom

Project Member

Comment 30 by bugdroid1@chromium.org, Sep 10

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

commit 44528dd55d01250ea5aff34a9ac6ded207370361
Author: Christopher Cameron <ccameron@chromium.org>
Date: Mon Sep 10 17:11:25 2018

RemoteMacViews: Remove browser deps from NativeWidgetMacNSWindow

Update NativeWidgetMacNSWindow to use the mojo BridgeNativeWidgetHost
interface instead of directly dereferencing views structures. Make
similar changes to ViewsNSWindowDelegate. Update the mojo interfaces
to include these functions.

Remove the nativeWidgetMac property from ViewsNSWindowDelegate.
Replace it with an "id" uint64_t on NativeWidgetMacNSWindow, which
can be used to look up a corresponding
- BridgedNativeWidgetImpl (in the app/viewer process)
- BridgedNativeWidgetHostImpl (in the browser process)
  - a follow-on patch will add a "shadow" NativeWidgetMacNSWindow
    in the browser process which will use this id
  - that window will not be visible, but will be used for state
    tracking and bounds computations

This is a re-land of crrev.com/589415, reverted at crrev.com/589415
because it introduced static initializers.

TBR=ellyjones,rsesek (reviewers of crrev.com/589415)

Bug: 859152
Change-Id: I00d4c91d09a9d281f372a2a452837e4537c30b35
Reviewed-on: https://chromium-review.googlesource.com/1214604
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589954}
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/bridged_native_widget_host.h
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/native_widget_mac_nswindow.h
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/native_widget_mac_nswindow.mm
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/views_nswindow_delegate.h
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/cocoa/views_nswindow_delegate.mm
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/44528dd55d01250ea5aff34a9ac6ded207370361/ui/views_bridge_mac/mojo/bridged_native_widget_host.mojom

Project Member

Comment 31 by bugdroid1@chromium.org, Sep 11

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

commit dc72e09f6eec243373216b3cedb9c2eebfb47713
Author: Daniel Bratell <bratell@opera.com>
Date: Tue Sep 11 10:51:32 2018

[jumbo] Make it one GetIdMap() instead of two.

A commit just introduced two GetIdMap functions in ui/views/cocoa,
which broke jumbo builds because in jumbo builds they end up in
the same translation unit. This patch renames them
GetIdToWidgetImplMap and GetIdToWidgetHostImplMap

Bug: 859152

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

Change-Id: I55b4a48d3d4f97c30450fd89bb8f52f46c2cedd7
Reviewed-on: https://chromium-review.googlesource.com/1219127
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#590257}
[modify] https://crrev.com/dc72e09f6eec243373216b3cedb9c2eebfb47713/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/dc72e09f6eec243373216b3cedb9c2eebfb47713/ui/views/cocoa/bridged_native_widget_host_impl.mm

Project Member

Comment 32 by bugdroid1@chromium.org, Sep 11

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

commit 64c7a9168c7c43d5ed333f9a9235af3ff6715188
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 11 16:36:01 2018

RemoteMacViews: Move NativeWindowProperty and AssociatedViews

Move Set/GetNativeWindowProperty to the browser-side
BridgedNativeWidgetHostImpl. Also, change from using a NSDictionary
attached to the NSWindow to just using a std::map -- these properties
do not actually need to be attached to the NSWindow.

Move Set/RemoveAssociationForView and ReorderChildViews to the
browser side, because that's where the views::View hierarchy is
stored. Compute the appropriate NSView->rank map and then send that
to the BridgedNativeWidgetImpl (in the future, this will be a
handle->rank map, when crossing process boundaries).

Bug: 859152
Change-Id: I142ec9eb180a81a9e456957bc9f42f32ab7de792
Reviewed-on: https://chromium-review.googlesource.com/1217450
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590343}
[modify] https://crrev.com/64c7a9168c7c43d5ed333f9a9235af3ff6715188/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/64c7a9168c7c43d5ed333f9a9235af3ff6715188/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/64c7a9168c7c43d5ed333f9a9235af3ff6715188/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/64c7a9168c7c43d5ed333f9a9235af3ff6715188/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/64c7a9168c7c43d5ed333f9a9235af3ff6715188/ui/views/controls/native/native_view_host_mac.mm
[modify] https://crrev.com/64c7a9168c7c43d5ed333f9a9235af3ff6715188/ui/views/widget/native_widget_mac.mm

Project Member

Comment 33 by bugdroid1@chromium.org, Sep 13

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

commit 3eb1690a52b9b1a8b39b0df0b8e357b0e4f44c44
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Sep 13 20:43:09 2018

RemoteMacViews: Add browser-side doppelganger NSWindow

Create a browser-side doppelganger NSWindow in
BridgedNativeWidgetHostImpl. This is because we use gfx::NativeWindow
(aka NSWindow pointer) as an identifier for the NativeWidgetMac all
over in the browser process, and when the "true NSWindow" is in the
app shim process, so we need some identifying structure on the
browser side.

Reshuffle some of the initialization of BridgedNativeWidgetHostImpl
in preparation for creating remote bridges. In particular, defer
creating the bridge object until CreateLocalBridge is called, and
touch up the places (tests, mostly) where the bridge is assumed to
always exist.

Bug: 859152
Change-Id: I85f3de97239763c9c9edb1313796be03c2043d8b
Reviewed-on: https://chromium-review.googlesource.com/1220401
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591142}
[modify] https://crrev.com/3eb1690a52b9b1a8b39b0df0b8e357b0e4f44c44/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/3eb1690a52b9b1a8b39b0df0b8e357b0e4f44c44/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/3eb1690a52b9b1a8b39b0df0b8e357b0e4f44c44/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/3eb1690a52b9b1a8b39b0df0b8e357b0e4f44c44/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/3eb1690a52b9b1a8b39b0df0b8e357b0e4f44c44/ui/views/widget/native_widget_mac.mm

Project Member

Comment 34 by bugdroid1@chromium.org, Sep 18

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

commit da75e6572ba3fea20aaa144b96f62d0f2189ba33
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 18 02:36:59 2018

RemoteMacViews: Add BridgeFactory to create remote BridgedNativeWidgets

Create a views_bridge_mac::mojom::BridgedFactory interface to create
remote views_bridge_mac::mojom::BridgedNativeWidget instances. The
chrome::mojom::AppShim interface will be updated in a follow-on patch
to have a method to provide a BridgedFactory instance.

Create a views_bridge_mac::mojom::BridgeFactoryImpl to instantiate
in the app shim process, to own the bridges.

Add a CreateWindow method to views_bridge_mac::mojom::BridgedFactory
to create a window in the app shim process. This function is not yet
expressive enough to encompass all window types needed, but is
sufficient for testing.

Add a BridgedNativeWidgetHostImpl::CreateRemoteBridge function to
create a remote bridge.

Bug: 859152
Change-Id: Iea81da4af7f3787f70474f49ba45c1c831d2fcc3
Reviewed-on: https://chromium-review.googlesource.com/1226251
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591920}
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/BUILD.gn
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/DEPS
[add] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/cocoa/bridge_factory_impl.h
[add] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/cocoa/bridge_factory_impl.mm
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views_bridge_mac/BUILD.gn
[add] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views_bridge_mac/mojo/bridge_factory.mojom
[modify] https://crrev.com/da75e6572ba3fea20aaa144b96f62d0f2189ba33/ui/views_bridge_mac/mojo/bridged_native_widget.mojom

Project Member

Comment 35 by bugdroid1@chromium.org, Sep 18

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

commit 7e16f1c9b58bc9f36e4c17da15019e5ed8c6216b
Author: Daniel Bratell <bratell@opera.com>
Date: Tue Sep 18 09:29:41 2018

Windows build fix: Only depend on views_bridge_mac in mac builds

views_bridge_mac now uses a function called CreateWindow which happens
to be a macro in Win32 APIs. If a Windows builds sees that function
and knows about the macro, the build breaks, as just happened in
jumbo builds after
https://chromium-review.googlesource.com/c/chromium/src/+/1226251

TBR=ellyjones@chromium.org

Bug: 859152
Change-Id: Ia2314b7697aa75f8df60310cc504848b86c3ed05
Reviewed-on: https://chromium-review.googlesource.com/1229675
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#591986}
[modify] https://crrev.com/7e16f1c9b58bc9f36e4c17da15019e5ed8c6216b/ui/views/BUILD.gn
[modify] https://crrev.com/7e16f1c9b58bc9f36e4c17da15019e5ed8c6216b/ui/views_bridge_mac/BUILD.gn

Project Member

Comment 36 by bugdroid1@chromium.org, Sep 18

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

commit 95865eec6cbe9a7f97614809223663de21dbbe0d
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 18 19:00:25 2018

RemoteMacViews: Add BridgeFactoryHost

Add a BridgeFactoryHost structure, which wraps a
views_bridge_mac::mojom::BridgeFactory interface. This structure has
an BridgeFactoryHost::Observer interface to call back into widgets
when the bridge factory they are using is destroyed (e.g, the app
shim is force-quit).

Bug: 859152
Change-Id: I0c34cf200588ac79d281b31ba85764bca0c02d39
Reviewed-on: https://chromium-review.googlesource.com/1229694
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592125}
[modify] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/BUILD.gn
[add] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/cocoa/bridge_factory_host.cc
[add] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/cocoa/bridge_factory_host.h
[modify] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/cocoa/bridge_factory_impl.h
[modify] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/cocoa/bridge_factory_impl.mm
[modify] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/95865eec6cbe9a7f97614809223663de21dbbe0d/ui/views/widget/native_widget_mac.mm

Project Member

Comment 37 by bugdroid1@chromium.org, Sep 18

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

commit 5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 18 23:22:23 2018

RemoteMacViews: Let AppShimHost create views_bridge_mac::BridgeFactorys

Add a method to chrome::mojom::AppShim that will create a
views_bridge_mac::BridgeFactory.

Add a views_bridge_mac::BridgeFactoryHost member to chrome::AppShim.
(This will be plumbed to NativeWidgetMac::InitWidgetMac via the
BrowserFrameMac sub-class, which lives in chrome).

Add myself as an OWNER for chrome/app_shim and
chrome/browser/apps/app_shim.

Bug: 859152
Change-Id: I1aaa46376599e0bf88f6f16b461c941c851c431c
Reviewed-on: https://chromium-review.googlesource.com/1229697
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592253}
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/app_shim/BUILD.gn
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/app_shim/OWNERS
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/app_shim/chrome_main_app_mode_mac.mm
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/browser/apps/app_shim/BUILD.gn
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/browser/apps/app_shim/OWNERS
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/browser/apps/app_shim/app_shim_host_mac.cc
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/browser/apps/app_shim/app_shim_host_mac.h
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/browser/apps/app_shim/app_shim_host_mac_unittest.cc
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/browser/apps/app_shim/app_shim_host_manager_browsertest_mac.mm
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/common/BUILD.gn
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/chrome/common/mac/app_shim.mojom
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/ui/views/BUILD.gn
[modify] https://crrev.com/5e4b28b18d666cb9c38cbaee8bcd3c650a4fb0b3/ui/views_bridge_mac/BUILD.gn

Project Member

Comment 38 by bugdroid1@chromium.org, Sep 21

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

commit 027e4add267dc767cff0088fdee45a7209a5190c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Sep 21 16:52:54 2018

RemoteMacViews: Get AppShimHost BridgeNativeFactory in NativeWidgetMac

There exist the following to endpoints that need to be hooked up
- NativeWidgetMac::InitWidget can use a views::BridgeFactoryHost
- AppShimHost has a views::BridgeFactoryHost that can create Cocoa UI
  in the app shim process

Hook these two up by
- Adding a virtual method NativeWidgetMac::GetBridgeFactoryHost
- Overriding this in the BrowserFrameMac sub-class
- Calling into apps::ExtensionAppShimHandler to find the
  apps::AppShimHandler::Host for the browser window
- Adding an apps::AppShimHandler::Host::GetBridgeFactoryHost method
- Overriding this in AppShimHost to return its views::BridgeFactoryHost

This involves adding the helper function
apps::ExtensionAppShimHandler::FindHostForBrowser. Most similar functions
are implemented as a static function that call GetInstance to effectively
make the function non-static. Because this is confusing, change such
instances to be non-static functions, and make public the GetInstance
method as apps::ExtensionAppShimHandler::Get.

Also do a little bit of cleanup in BridgedNativeWidgetHostImpl so that
we don't crash immediately
- Make GetBoundsOffsetForParent not dereference null and add a comment
  that its logic needs updating
- Remove |has_received_window_geometry_| because the approach that it
  assumed will not work

R=tapted
TBR=avi (for chrome/ OWNERship)

Bug: 859152
Change-Id: I9873e0c70b07468fefa90a574606cca1ed54a951
Reviewed-on: https://chromium-review.googlesource.com/1235221
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593228}
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/app_controller_mac.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/apps/app_shim/app_shim_handler_mac.h
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/apps/app_shim/app_shim_host_mac.cc
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/apps/app_shim/app_shim_host_mac.h
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/apps/app_shim/app_shim_quit_interactive_uitest_mac.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.cc
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/apps/app_shim/extension_app_shim_handler_mac_unittest.cc
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/ui/views/frame/browser_frame_mac.h
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/chrome/browser/ui/views/frame/browser_frame_mac.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/ui/views/widget/native_widget_mac.h
[modify] https://crrev.com/027e4add267dc767cff0088fdee45a7209a5190c/ui/views/widget/native_widget_mac.mm

Project Member

Comment 39 by bugdroid1@chromium.org, Sep 25

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

commit 57dee5a4fe97fba6dedfa13f9e1985f15b040c1f
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 25 01:20:08 2018

RemoteMacViews: Add about:flags entry for RemoteMacViews

The feature has been around for a while, but having it in about:flags
will help development along.

Bug: 859152
Change-Id: I3da5fff7b57961f3c41a628c69a9b65b69122860
Reviewed-on: https://chromium-review.googlesource.com/1226298
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593797}
[modify] https://crrev.com/57dee5a4fe97fba6dedfa13f9e1985f15b040c1f/chrome/browser/about_flags.cc
[modify] https://crrev.com/57dee5a4fe97fba6dedfa13f9e1985f15b040c1f/chrome/browser/flag_descriptions.cc
[modify] https://crrev.com/57dee5a4fe97fba6dedfa13f9e1985f15b040c1f/chrome/browser/flag_descriptions.h
[modify] https://crrev.com/57dee5a4fe97fba6dedfa13f9e1985f15b040c1f/tools/metrics/histograms/enums.xml
[modify] https://crrev.com/57dee5a4fe97fba6dedfa13f9e1985f15b040c1f/ui/base/ui_base_features.h

Project Member

Comment 40 by bugdroid1@chromium.org, Sep 25

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

commit f482cf79bbed63689f4d47506df1a30ae87e33c7
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 25 22:50:17 2018

RemoteMacViews: Make window resize smooth

Use the RenderWidgetResizeHelper's task runner to handle the mojo
messages to and from the BridgedNativeWidget and
BridgedNativeWidgetHost.

Bug: 859152
Change-Id: I3d9fab6cd81edafd74e45d06c658d1bd15e1fde4
Reviewed-on: https://chromium-review.googlesource.com/1244103
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594134}
[modify] https://crrev.com/f482cf79bbed63689f4d47506df1a30ae87e33c7/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/f482cf79bbed63689f4d47506df1a30ae87e33c7/ui/views/cocoa/bridged_native_widget_host_impl.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/+/dd7c59f4ad5f190fa23de63c834807b1a2604a99

commit dd7c59f4ad5f190fa23de63c834807b1a2604a99
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Sep 25 23:42:09 2018

RemoteMacViews: Break views dependencies of DragDropClientMac

DragDropClientMac is one of the few remaining structures that Cocoa
and Views code depends on. Break this dependency cycle, so that we can
move all Cocoa code to ui/views_brige_mac.
* Separate out the interface that Cocoa depends on and move it to
  views_bridge_mac::DragDropClient.
* Make views::DragDropClientMac be a member of the browser side
  structure views::BridgedNativeWidgetHostImpl

Note that this does not solve the problem that drag drop behavior is
not implemented over mojo. When using RemoteMacViews, drag drop
functionality will still be absent.

Bug: 859152
Change-Id: I3d5b8a3b8ae9403effd17436e727ba4298bcae61
Reviewed-on: https://chromium-review.googlesource.com/1244720
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594144}
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/bridge_factory_impl.mm
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/drag_drop_client_mac.h
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/cocoa/drag_drop_client_mac_unittest.mm
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views_bridge_mac/BUILD.gn
[modify] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views_bridge_mac/bridged_native_widget_host_helper.h
[add] https://crrev.com/dd7c59f4ad5f190fa23de63c834807b1a2604a99/ui/views_bridge_mac/drag_drop_client.h

Project Member

Comment 42 by bugdroid1@chromium.org, Sep 26

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

commit dbefcbb07aa76d64a69787b1aff0113fff5ee107
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Sep 26 16:37:02 2018

RemoteMacViews: Remove remaining ui/views/ includes

Remove the remaining places where code that is going to be moved into
ui/views_bridge_mac includes a file from ui/views.

This includes
* The enum used by BridgedNativeWidgetImpl::SetTransitionsToAnimate.
  This is changed to a mojo enum and added to a mojo interface.
* BridgedNativeWidgetImpl::RunMoveLoop. This is changed to a bool,
  and still relies on a raw pointer to invoke (does not work over mojo
  yet).
* BridgedNativeWidgetImpl::OnWindowNativeThemeChanged, changed to
  a mojo method calling BridgedNativeWidgetHostImpl

Bug: 859152
Change-Id: I62424b46825788cbb9367ebf9e62c54bace1e6af
Reviewed-on: https://chromium-review.googlesource.com/1244822
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594344}
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views/cocoa/bridged_native_widget.h
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views/cocoa/bridged_native_widget.mm
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views/cocoa/cocoa_window_move_loop.h
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views/cocoa/cocoa_window_move_loop.mm
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views_bridge_mac/mojo/bridged_native_widget.mojom
[modify] https://crrev.com/dbefcbb07aa76d64a69787b1aff0113fff5ee107/ui/views_bridge_mac/mojo/bridged_native_widget_host.mojom

Project Member

Comment 43 by bugdroid1@chromium.org, Sep 27

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

commit a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Sep 27 18:51:42 2018

MacPWAs: Add factory for remote RenderWidgetHostView

Add a new interface, content::mojom::NSViewBridgeFactory. This may be
used to create a content::mojo::RenderWidgetHostNSViewBridge in
another process, and initialize its client to a specified
content::mojo::RenderWidgetHostNSViewClient.
  * Note that the interface created by mojom::NSViewBridgeFactory is a
    stub interface, mojom::StubInterface, which is cast to a
    mojom::RenderWidgetHostNSViewBridge. This is because the latter
    has content-internal dependencies, and so cannot be included in
    any other module.

Add a content::NSViewBridgeFactoryHost class that will own such
a connection. There will exist one instance of this class for each
AppShimHost in the browser process.
  * Included in this a "host id". This will be set at initialization to
    match a views::BridgeFactoryHost.
  * When embedding web contents into a views::View, the
    views::BridgedNativeWidgetHostImpl will specify this id to the
    content::RenderWidgetHostViewMac, to ensure that all NSViews be
    created in the same process.

Add a content::NSViewBridgeFactoryImpl class that implements the
content::mojom::NSViewBridgeFactory interface. There will exist one
global instance of this class in each app shim process.

Add to content::RenderWidgetHostViewMac a MigrateNSViewBridge function,
which will move corresponding NSView to a different host.

Add to RenderWidgetHostNSViewBridgeLocal a constructor that takes
mojo interfaces. This constructor is called in the app shim process.
Clarify that the creator of the RenderWidgetHostNSViewBridgeLocal is
its owner, and is responsible for its destruction.

Note that all interfaces are associated. This is because call ordering
needs to be preserved amongst multiple NSViews (e.g, to add one as a
subview of another, but only once both have been put in an expected
state).

Bug: 859152
Change-Id: I69f64c57cf51189ca75e215346f3ef1cbab23094
Reviewed-on: https://chromium-review.googlesource.com/1239763
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594797}
[modify] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/browser/BUILD.gn
[add] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/browser/ns_view_bridge_factory_host.mm
[add] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/browser/ns_view_bridge_factory_impl.mm
[modify] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.h
[modify] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/browser/renderer_host/render_widget_host_ns_view_bridge_local.mm
[modify] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/public/browser/BUILD.gn
[add] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/public/browser/ns_view_bridge_factory_host.h
[add] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/public/browser/ns_view_bridge_factory_impl.h
[modify] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/public/common/BUILD.gn
[add] https://crrev.com/a2bf5a4a3ea5dfe6c5d9d6d80e3880d4a03c6c1b/content/public/common/ns_view_bridge_factory.mojom

Project Member

Comment 44 by bugdroid1@chromium.org, Sep 28

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

commit 2d9ed2a27cc7041d5020a8943a54f9e1b25228f2
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Sep 28 01:06:29 2018

RemoteMacViews: Initialize WindowResizeHelperMac

This was accidentally dropped from crrev.com/594134

Bug: 859152
Change-Id: I159af36686ce07300969f2eaf79796be85f012e5
Reviewed-on: https://chromium-review.googlesource.com/1244886
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@{#594941}
[modify] https://crrev.com/2d9ed2a27cc7041d5020a8943a54f9e1b25228f2/chrome/app_shim/BUILD.gn
[modify] https://crrev.com/2d9ed2a27cc7041d5020a8943a54f9e1b25228f2/chrome/app_shim/chrome_main_app_mode_mac.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/+/d0b8c43ac035a1a8dfccf08b1d9af8924cd0afd2

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

Break native parenting of NativeWidgetMac

In theory, views::Widget::ReparentNativeView and
views::Widget::InitParams allow specifying any NSView* as the parent of
a views::Widget.

The only parent ever actually specified in production is the NSView*
corresponding to the root views::View of another views::Widget.

Add a CHECK to verify that this is the case. If the CHECK is not hit,
then we remove this functionality. Continue to allow testing of this
path (for now) by disabling this CHECK via a static method.

Bug: 859152
Change-Id: I70a9a22352e22b1949d37c86c36388ed5380316b
Reviewed-on: https://chromium-review.googlesource.com/1255863
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595752}
[modify] https://crrev.com/d0b8c43ac035a1a8dfccf08b1d9af8924cd0afd2/ui/views/widget/native_widget_mac_unittest.mm
[modify] https://crrev.com/d0b8c43ac035a1a8dfccf08b1d9af8924cd0afd2/ui/views_bridge_mac/widget_owner_nswindow_adapter.h
[modify] https://crrev.com/d0b8c43ac035a1a8dfccf08b1d9af8924cd0afd2/ui/views_bridge_mac/widget_owner_nswindow_adapter.mm

Project Member

Comment 46 by bugdroid1@chromium.org, Oct 4

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

commit de14cc6ad5c8b1574a2b6e6bd6dfc12719c8994f
Author: Christopher Cameron <ccameron@chromium.org>
Date: Thu Oct 04 01:16:23 2018

MacViews: Remove native parent support

Require that the parent of a NativeWidgetMac always be either
- an NSView in the NSWindow of another NativeWidgetMac
- a nil NSView

Remove WidgetOwnerNSWindowAdapter (which enabled this functionality)
and BridgedNativeWidgetOwner (the interface it implements).

Update tests that happen to use this functionality so that they don't
use native view parents.

Bug: 859152
Change-Id: I69ea160852be5a44c7e2952445bd1115de72bd8e
Reviewed-on: https://chromium-review.googlesource.com/c/1258292
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596465}
[modify] https://crrev.com/de14cc6ad5c8b1574a2b6e6bd6dfc12719c8994f/ui/views/BUILD.gn
[modify] https://crrev.com/de14cc6ad5c8b1574a2b6e6bd6dfc12719c8994f/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/de14cc6ad5c8b1574a2b6e6bd6dfc12719c8994f/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/de14cc6ad5c8b1574a2b6e6bd6dfc12719c8994f/ui/views/widget/native_widget_mac_unittest.mm
[modify] https://crrev.com/de14cc6ad5c8b1574a2b6e6bd6dfc12719c8994f/ui/views_bridge_mac/bridged_native_widget_impl.h
[modify] https://crrev.com/de14cc6ad5c8b1574a2b6e6bd6dfc12719c8994f/ui/views_bridge_mac/bridged_native_widget_impl.mm
[delete] https://crrev.com/14e8e7cc35dfce321cccaec55f1fccf4eed2daf1/ui/views_bridge_mac/bridged_native_widget_owner.h
[delete] https://crrev.com/14e8e7cc35dfce321cccaec55f1fccf4eed2daf1/ui/views_bridge_mac/widget_owner_nswindow_adapter.h
[delete] https://crrev.com/14e8e7cc35dfce321cccaec55f1fccf4eed2daf1/ui/views_bridge_mac/widget_owner_nswindow_adapter.mm

Project Member

Comment 47 by bugdroid1@chromium.org, Oct 5

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

commit 739f7f623dc7afe54e27690fa28d5f5dc8d3fa9c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Oct 05 17:06:33 2018

RemoteMacViews: Fix context menus

This fix has two parts.

First, call -[NSView addSubview:] in views::NativeViewHostMac, instead
of calling it in views::BridgedNativeWidgetHostImpl. This will set up
the browser-side NSView hierarchy, even when the browser-side NSViews
are not visible (because the app-side NSViews are).

Second, in BridgedNativeWidgetHostImpl::OnWindowGeometryChanged, update
the geometry of the browser-side doppelganger NSWindow to match the
geometry of the app-side true NSWindow. This ensures that the context
menu appears in the right place.

Both of these fixes are band-aids on the larger issue that we should
change the gfx::NativeView and gfx::NativeWindow types to be a wrapper
interface that will clearly delineate the where the native types
are actually manipulated, and where the native types are just plumbed
through.

Bug: 859152
Change-Id: I8428166dd889f45888432220be70de340574c385
Reviewed-on: https://chromium-review.googlesource.com/c/1263592
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597174}
[modify] https://crrev.com/739f7f623dc7afe54e27690fa28d5f5dc8d3fa9c/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/739f7f623dc7afe54e27690fa28d5f5dc8d3fa9c/ui/views/controls/native/native_view_host_mac.mm

Project Member

Comment 48 by bugdroid1@chromium.org, Oct 5

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

commit d483977373519ef0178f7e446d08a64fd231ad4f
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Oct 05 19:26:55 2018

RemoteMacViews: Track parent and children in BridgedNativeWidgetHostImpl

Track parent and children in BridgedNativeWidgetHostImpl. This tracking
is already done in BridgedNativeWidgetImpl, which is not necessarily
accessible in the browser process.

Update the parent in NativeWidgetPrivate::ReparentNativeView, but
only when the BridgedNativeWidgetImpl state would be updated by
BridgedNativeWidgetImpl::ReparentNativeView.

Remove BridgedNativeWidgetHostImpl from its parent in OnWindowWillClose.
Move removal of children from being in BridgedNativeWidgetImpl's
destructor to between calling OnWindowWillClose and OnWindowHasClosed,
to ensure that all children have detached themselves before their
parent is destroyed.

Update some functions in NativeWidgetMac and NativeWidgetPrivate to
use the state in BridgedNativeWidgetHostImpl, instead of using the
state in BridgedNativeWidgetImpl.

Bug: 859152
Change-Id: Id98b9239db88154d9304f84d369d40d47af61d0f
Reviewed-on: https://chromium-review.googlesource.com/c/1262624
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597238}
[modify] https://crrev.com/d483977373519ef0178f7e446d08a64fd231ad4f/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/d483977373519ef0178f7e446d08a64fd231ad4f/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/d483977373519ef0178f7e446d08a64fd231ad4f/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/d483977373519ef0178f7e446d08a64fd231ad4f/ui/views_bridge_mac/bridged_native_widget_impl.mm

Blockedon: 893719
Project Member

Comment 50 by bugdroid1@chromium.org, Oct 9

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

commit 377a6e1e8f827bb8a0746f2ec50b2244f973d09d
Author: Christopher Cameron <ccameron@chromium.org>
Date: Tue Oct 09 20:28:38 2018

RemoteMacViews: Set BridgedNativeWidget parents through mojo

Add a SetParent mojo method to BridgedNativeWidget, and have this
method take the id of the parent widget.

Remove specifying the parent from BridgedNativeWidgetHostImpl's
CreateLocalBridge and CreateRemoteBridge functions, and make it a
stand-alone function.

Bug: 859152
Change-Id: I77df95e0e531d9ab507a3f5d3358833f70f0ab9f
Reviewed-on: https://chromium-review.googlesource.com/c/1262659
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598064}
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views/cocoa/bridged_native_widget_unittest.mm
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views/widget/native_widget_mac_unittest.mm
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views_bridge_mac/bridged_native_widget_impl.h
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views_bridge_mac/bridged_native_widget_impl.mm
[modify] https://crrev.com/377a6e1e8f827bb8a0746f2ec50b2244f973d09d/ui/views_bridge_mac/mojo/bridged_native_widget.mojom

Blockedon: 893821
Project Member

Comment 52 by bugdroid1@chromium.org, Oct 10

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

commit 10b40b6ce991f6787ab90a882acdffa311130e9c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Wed Oct 10 22:11:17 2018

RemoteMacViews: Clean up SetBounds and SetSize

Remove the host-side function GetBoundsOffsetForParent, and pass the
one parameter that it needs from the host-side,
PositionWindowInScreenCoordinates, as a parameter during
initialization (over mojo). Move the computation of the parent offset
over to the viewer process.

Move the implementation of the function NativeWidgetMac::CenterWindow
from the host-side to the viewer-side, with the size argument passed
over mojo.

Bug: 859152
Change-Id: I48b7a3485637383a9f6dc6a3812b4c25d45a3754
Reviewed-on: https://chromium-review.googlesource.com/c/1272679
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598534}
[modify] https://crrev.com/10b40b6ce991f6787ab90a882acdffa311130e9c/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/10b40b6ce991f6787ab90a882acdffa311130e9c/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/10b40b6ce991f6787ab90a882acdffa311130e9c/ui/views/widget/native_widget_mac.mm
[modify] https://crrev.com/10b40b6ce991f6787ab90a882acdffa311130e9c/ui/views_bridge_mac/bridged_native_widget_impl.h
[modify] https://crrev.com/10b40b6ce991f6787ab90a882acdffa311130e9c/ui/views_bridge_mac/bridged_native_widget_impl.mm
[modify] https://crrev.com/10b40b6ce991f6787ab90a882acdffa311130e9c/ui/views_bridge_mac/mojo/bridged_native_widget.mojom

Project Member

Comment 53 by bugdroid1@chromium.org, Oct 12

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

commit 800a927eb503828f5cf6f489739e1a6efc444429
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Oct 12 06:34:55 2018

RemoteMacViews: Make fullscreen mode not crash

Fix a few places where we would dereference a BridgedNativeWidgetImpl
which is null when out-of-process. This doesn't guarantee correct
behavior, but avoids a crash.

Make WebContentsNSViewBridge::Show resize the web contents view and
also all of its children.

Bug: 859152
Change-Id: I948de1e4f79db4a51c5b86e7960356133eff4342
Reviewed-on: https://chromium-review.googlesource.com/c/1278533
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599119}
[modify] https://crrev.com/800a927eb503828f5cf6f489739e1a6efc444429/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller_views.mm
[modify] https://crrev.com/800a927eb503828f5cf6f489739e1a6efc444429/content/browser/web_contents/web_contents_ns_view_bridge.mm

Project Member

Comment 54 by bugdroid1@chromium.org, Oct 12

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

commit 5e5f92365f557682da0990cfa44e9be3c576695c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Oct 12 18:19:06 2018

RemoteMacViews: Assorted small fixes

Update WebContentsViewMac to always report the view as visible when
it is hosted in a remote process.

Fix an a11y crash crash in BridgedContentView's
accessibilityAttributeValue function.

Make the doppelganger NativeWidgetMacNSWindow in the browser process
be transparent and have no controls (closing that window causes
complicated lifetime issues).

Make NativeWidgetMacNSWindow directly store a pointer to its
BridgedNativeWidgetImpl, instead of looking it up by id.
- This was causing problems where the doppelganger window in the
  browser process was fighting with the true NativeWidgetMacNSWindow
  in the app shim.
- When the gfx::NativeWindow handle patch lands, we can make the
  doppelganger window be a different class, which will help to
  de-confuse things.

Update NativeViewHostMac::GetViewsFactoryHostId to return the same
sentinel value for "use the local process" as is used in content (this
had been causing LOG errors).

Bug: 859152
Change-Id: Ic0222351a54b20387c019263ee1a04d03461c063
Reviewed-on: https://chromium-review.googlesource.com/c/1278294
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599295}
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/content/browser/web_contents/web_contents_view_mac.h
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/content/browser/web_contents/web_contents_view_mac.mm
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/ui/views/controls/native/native_view_host_mac.mm
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/ui/views_bridge_mac/bridged_content_view.mm
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/ui/views_bridge_mac/bridged_native_widget_impl.mm
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/ui/views_bridge_mac/native_widget_mac_nswindow.h
[modify] https://crrev.com/5e5f92365f557682da0990cfa44e9be3c576695c/ui/views_bridge_mac/native_widget_mac_nswindow.mm

Project Member

Comment 55 by bugdroid1@chromium.org, Oct 12

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

commit 0da2b24bbad1996e6cf88c554433ee2e8dfe134c
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Oct 12 18:22:32 2018

RemoteMacViews: Fix app shim focus

The function BridgedNativeWidgetHostImpl::SetIsFirstResponder is called
when the BridgedContentView observes that it became or lost first
responder.

When losing first responder, this would call ClearNativeFocus inside
FocusManager::StoreFocusedView, which would then make the
BridgedContentView first responder again.

That would happen to not be a problem for the synchronous in-process
mode because the call sequence is
1. -[NSWindow _realMakeFirstResponder:], which internally calls
  2. -[BridgedContentView resignFirstResponder], which calls
    3. BridgedNativeWidgetHostImpl::SetIsFirstResponder, calls
      4. FocusManager::StoreFocusedView which eventually calls
        5. -[NSWindow makeFirstResponder:], which is now recursively
           setting the first responder set. This either has no effect
           or is overridden by the below calls
  6. -[NSView becomeFirstResponder] for the new NSView that now has
     focus

But when we're running this out-of-process, the call to 3 is an IPC
back to the browser, so we have the sequence 1, 2, 6, 3, 4, 5, and now
the call to makeFirstResponder in step 5 actually does something.

Fix this by just not calling ClearNativeFocus (which is consistent, as
this is just observing a change in state that has occurred, not
requesting a change in state).

Bug: 859152
Change-Id: I289c652228bbaa1ca58aa2ec72ff87dd422a54d9
Reviewed-on: https://chromium-review.googlesource.com/c/1272680
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599297}
[modify] https://crrev.com/0da2b24bbad1996e6cf88c554433ee2e8dfe134c/ui/views/cocoa/bridged_native_widget_host_impl.h
[modify] https://crrev.com/0da2b24bbad1996e6cf88c554433ee2e8dfe134c/ui/views/cocoa/bridged_native_widget_host_impl.mm
[modify] https://crrev.com/0da2b24bbad1996e6cf88c554433ee2e8dfe134c/ui/views_bridge_mac/bridged_content_view.mm
[modify] https://crrev.com/0da2b24bbad1996e6cf88c554433ee2e8dfe134c/ui/views_bridge_mac/mojo/bridged_native_widget_host.mojom

Blockedon: 895139
Blockedon: 895169
Blockedon: 895700
Blockedon: 896917
Blockedon: 897866
Blockedon: 898604
Blockedon: 898608
Blockedon: 898612
Blockedon: 898627
Blockedon: 900846
Blockedon: 901490
Project Member

Comment 68 by bugdroid1@chromium.org, Nov 2

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

commit 6aba1673b93eeae6ba09da7b558e849cd2de5d74
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Nov 02 22:46:32 2018

RemoteMacViews: Forward key events

Populate the method to send these events to the browser.

Bug: 859152
Change-Id: I47f0ba77340eaa185ad2ac58670d9f9909c7a698
Reviewed-on: https://chromium-review.googlesource.com/c/1315705
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605076}
[modify] https://crrev.com/6aba1673b93eeae6ba09da7b558e849cd2de5d74/ui/views_bridge_mac/bridge_factory_impl.mm

 Issue 631497  has been merged into this issue.
Blockedon: 913688
Cc: sc00335...@techmahindra.com ligim...@chromium.org benwells@chromium.org jackhou@chromium.org
 Issue 308382  has been merged into this issue.
Blocking: 484737

Sign in to add a comment