DescriptionMacViews: Allow views::Widgets to be parented off NSWindows
Currently, a views::Widget on Mac can't be owned by a NSWindow that is
not also a views::Widget. This would mean that to add a toolkit-views
dialog parented to the browser, the whole browser window would need to
be ported to views first.
This CL abstracts the responsibilities of a NativeViewMac's parent
window into a BridgedNativeWidgetOwner interface which
BridgedNativeWidget implements to retain the current behaviour.
WidgetOwnerNSWindowAdapter is a lightweight class that implements this
to allow the parent to be any native NSView. The parent window closing
will also close the child, and (for appropriate child types) the child
window frame is offset by the parent view's position on screen.
BUG=447086
TEST=views_unittests' NativeWidgetMacTest.NonWidgetParent
Committed: https://crrev.com/adc5eefaf1611f00b4b3482baa07bb10a335c681
Cr-Commit-Position: refs/heads/master@{#329097}
Patch Set 1 #Patch Set 2 : rebase #Patch Set 3 : Enable web_dialog_view_browsertest on Mac #Patch Set 4 : Add a test and fix a sortof bug #Patch Set 5 : fix upstream #Patch Set 6 : fix gyp #
Total comments: 14
Patch Set 7 : respond to comments #
Total comments: 2
Patch Set 8 : fix constness #
Messages
Total messages: 24 (10 generated)
|