DescriptionMacViews: Implement NativeViewHostMac (take 3)
This is done in a comparable way to NativeViewHostAura, but using a
ReparentNSView helper function which reparents an NSView to a
NativeWidgetMac's BridgedContentView (or to `nil`).
Earlier attempts tried to use NativeWidgetPrivate::ReparentNativeView()
which turns out to be a bad idea, since it's really designed to reparent
windows (aura::Windows or HWNDs). Mac's child window support is
insufficient for what toolkit-views expects, and WebContents on Mac are
managed by an NSView in any case, not an NSWindow.
Along with logic currently in render_widget_host_view_mac.mm and
web_contents_view_mac.mm, reparenting renderer views needs to be done in
the native view hierarchy, not the window hierarchy.
This CL no longer tries to enable the current
native_view_host_unittest.cc (tests there assume ReparentNativeView is
used), but adds native_view_host_mac_unittest.mm to give test coverage,
and to inspect properties at the Cocoa layer. Common parts of the 3
_unittest.* files are refactored into a NativeViewHostTestBase class.
Some other views_unittests are also made passing by implementing a
NativeViewHost::CreateWrapper that doesn't just return NULL:
4xFocusTraverslTest and NativeWidgetTest.GetTopLevelNativeWidget2
Before: 455 tests run 22 tests failed 21 tests crashed. After: 458 tests
run 22 tests failed 16 tests crashed.
BUG=378134, 415024
Committed: https://crrev.com/5ee3db9894c69bd53f19c92b38a39c4a345e8ec0
Cr-Commit-Position: refs/heads/master@{#295618}
Patch Set 1 #Patch Set 2 : New approach - but needs a better child window API #Patch Set 3 : Ditch helper widget, add more tests #Patch Set 4 : rebase #Patch Set 5 : neaten it all up #Patch Set 6 : Old, rebased, patch from crrev/509943002 - pretty different though #Patch Set 7 : Back to the "real" patch #
Total comments: 4
Patch Set 8 : fix upstream #Patch Set 9 : acceptsFirstResponder, cleanup strays #Messages
Total messages: 17 (9 generated)
|