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

Issue 1063933003: MacViews: Allow views::Widgets to be parented off NSWindows (Closed)

Created:
5 years, 8 months ago by tapted
Modified:
5 years, 7 months ago
Reviewers:
Andre, sky
CC:
chromium-reviews, tfarina, tdanderson+views_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@20150401-MacViews-AppInfo-Standalone
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -46 lines) Patch
M ui/views/cocoa/bridged_native_widget.h View 1 2 3 4 5 6 7 6 chunks +11 lines, -6 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.mm View 1 2 3 4 5 6 7 11 chunks +51 lines, -34 lines 0 comments Download
A ui/views/cocoa/bridged_native_widget_owner.h View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
A ui/views/cocoa/widget_owner_nswindow_adapter.h View 1 2 3 4 5 6 7 1 chunk +47 lines, -0 lines 0 comments Download
A ui/views/cocoa/widget_owner_nswindow_adapter.mm View 1 2 3 4 5 6 7 1 chunk +93 lines, -0 lines 0 comments Download
M ui/views/views.gyp View 1 2 3 4 5 7 2 chunks +3 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_mac.mm View 1 2 3 4 7 1 chunk +6 lines, -6 lines 0 comments Download
M ui/views/widget/native_widget_mac_unittest.mm View 1 2 3 4 5 6 2 chunks +62 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (10 generated)
tapted
Hi Andre, please take a look.
5 years, 7 months ago (2015-05-07 12:56:47 UTC) #4
Andre
https://codereview.chromium.org/1063933003/diff/140001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/1063933003/diff/140001/ui/views/cocoa/bridged_native_widget.mm#newcode683 ui/views/cocoa/bridged_native_widget.mm:683: return parent()->IsVisibleParent(); How about, return parent() ? parent()->IsVisibleParent() && ...
5 years, 7 months ago (2015-05-07 17:32:38 UTC) #5
tapted
(note there's a small rebase in native_widget_mac.mm) Thanks Andre! https://codereview.chromium.org/1063933003/diff/140001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/1063933003/diff/140001/ui/views/cocoa/bridged_native_widget.mm#newcode683 ui/views/cocoa/bridged_native_widget.mm:683: ...
5 years, 7 months ago (2015-05-07 23:43:51 UTC) #6
Andre
LGTM
5 years, 7 months ago (2015-05-07 23:48:19 UTC) #7
tapted
+sky for views.gyp OWNERS (or any other comments you may have :) - Thanks!
5 years, 7 months ago (2015-05-07 23:49:31 UTC) #9
sky
LGTM with fixed constness. https://codereview.chromium.org/1063933003/diff/160001/ui/views/cocoa/bridged_native_widget.h File ui/views/cocoa/bridged_native_widget.h (right): https://codereview.chromium.org/1063933003/diff/160001/ui/views/cocoa/bridged_native_widget.h#newcode156 ui/views/cocoa/bridged_native_widget.h:156: BridgedNativeWidgetOwner* parent() const { return ...
5 years, 7 months ago (2015-05-08 16:41:26 UTC) #10
tapted
https://codereview.chromium.org/1063933003/diff/160001/ui/views/cocoa/bridged_native_widget.h File ui/views/cocoa/bridged_native_widget.h (right): https://codereview.chromium.org/1063933003/diff/160001/ui/views/cocoa/bridged_native_widget.h#newcode156 ui/views/cocoa/bridged_native_widget.h:156: BridgedNativeWidgetOwner* parent() const { return parent_; } On 2015/05/08 ...
5 years, 7 months ago (2015-05-09 05:00:21 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1063933003/180001
5 years, 7 months ago (2015-05-09 05:01:02 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) android_chromium_gn_compile_rel on ...
5 years, 7 months ago (2015-05-09 12:15:51 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1063933003/180001
5 years, 7 months ago (2015-05-10 00:29:25 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
5 years, 7 months ago (2015-05-10 04:32:51 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1063933003/180001
5 years, 7 months ago (2015-05-10 23:19:53 UTC) #22
commit-bot: I haz the power
Committed patchset #8 (id:180001)
5 years, 7 months ago (2015-05-11 05:59:14 UTC) #23
commit-bot: I haz the power
5 years, 7 months ago (2015-05-11 06:00:06 UTC) #24
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/adc5eefaf1611f00b4b3482baa07bb10a335c681
Cr-Commit-Position: refs/heads/master@{#329097}

Powered by Google App Engine
This is Rietveld 408576698