Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Issue 530933002: MacViews: Implement NativeViewHostMac (take 3) (Closed)

Created:
6 years, 3 months ago by tapted
Modified:
6 years, 3 months ago
Reviewers:
Andre, sky
CC:
chromium-reviews, tfarina, ben+views_chromium.org, tdanderson+views_chromium.org, chrome-apps-syd-reviews_chromium.org, mac-views-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

MacViews: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+481 lines, -116 lines) Patch
M ui/views/controls/native/native_view_host.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M ui/views/controls/native/native_view_host_aura_unittest.cc View 1 2 3 4 6 4 chunks +12 lines, -60 lines 0 comments Download
A ui/views/controls/native/native_view_host_mac.h View 2 3 4 5 7 8 1 chunk +45 lines, -0 lines 0 comments Download
D ui/views/controls/native/native_view_host_mac.cc View 1 chunk +0 lines, -18 lines 0 comments Download
A ui/views/controls/native/native_view_host_mac.mm View 1 2 3 4 5 6 7 8 1 chunk +142 lines, -0 lines 0 comments Download
A ui/views/controls/native/native_view_host_mac_unittest.mm View 1 2 3 4 5 6 7 8 1 chunk +128 lines, -0 lines 0 comments Download
A ui/views/controls/native/native_view_host_test_base.h View 1 2 3 4 6 1 chunk +62 lines, -0 lines 0 comments Download
A ui/views/controls/native/native_view_host_test_base.cc View 1 2 6 1 chunk +80 lines, -0 lines 0 comments Download
M ui/views/controls/native/native_view_host_unittest.cc View 1 2 3 4 6 1 chunk +3 lines, -35 lines 0 comments Download
M ui/views/views.gyp View 1 2 3 4 6 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 17 (9 generated)
tapted
Hi Andre - could you take an initial look? (note there's a recent compile regression ...
6 years, 3 months ago (2014-09-17 12:24:52 UTC) #3
Andre
lgtm https://codereview.chromium.org/530933002/diff/140001/ui/views/controls/native/native_view_host_mac.mm File ui/views/controls/native/native_view_host_mac.mm (right): https://codereview.chromium.org/530933002/diff/140001/ui/views/controls/native/native_view_host_mac.mm#newcode119 ui/views/controls/native/native_view_host_mac.mm:119: [[host_->native_view() window] makeFirstResponder:host_->native_view()]; From -[NSWindow makeFirstResponder:] documentation: If ...
6 years, 3 months ago (2014-09-17 20:57:14 UTC) #4
tapted
https://codereview.chromium.org/530933002/diff/140001/ui/views/controls/native/native_view_host_mac.mm File ui/views/controls/native/native_view_host_mac.mm (right): https://codereview.chromium.org/530933002/diff/140001/ui/views/controls/native/native_view_host_mac.mm#newcode119 ui/views/controls/native/native_view_host_mac.mm:119: [[host_->native_view() window] makeFirstResponder:host_->native_view()]; On 2014/09/17 20:57:13, Andre wrote: > ...
6 years, 3 months ago (2014-09-18 08:40:14 UTC) #10
tapted
+sky - please take a look. You can diff against patchset 6 to see the ...
6 years, 3 months ago (2014-09-18 08:42:40 UTC) #12
sky
LGTM
6 years, 3 months ago (2014-09-18 12:58:29 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/530933002/280001
6 years, 3 months ago (2014-09-18 23:06:36 UTC) #15
commit-bot: I haz the power
Committed patchset #9 (id:280001) as 4dbb8443c28af960c0d778a506d7387afccceb01
6 years, 3 months ago (2014-09-19 00:12:33 UTC) #16
commit-bot: I haz the power
6 years, 3 months ago (2014-09-19 00:13:07 UTC) #17
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/5ee3db9894c69bd53f19c92b38a39c4a345e8ec0
Cr-Commit-Position: refs/heads/master@{#295618}

Powered by Google App Engine
This is Rietveld 408576698