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

Issue 927233003: MacViews: Fix positioning of top-level Widgets with parents (Closed)

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

Description

MacViews: Fix positioning of top-level Widgets with parents In doing so, consolidate calls to `SetBounds` for MacViews. In toolkit-views, a Widget is considered "top-level" if it it doesn't have the "child" flag set on InitParams. All widgets (both top-level and not) can have their lifetime controlled by a "parent" window. Parented, but "non-child", windows are positioned with coordinates relative to the screen, not relative to the parent window that owns them. For Aura, the logic that does this is in a wm::ScreenPositionClient. MacViews is currently missing the logic in DesktopScreenPositionClient::SetBounds(..). This CL adds the same logic to BridgedNativeWidget::SetBounds(), and moves tests from widget/desktop_aura/desktop_screen_position_client_unittest.cc to widget/desktop_widget_unittest.cc since they are cross-platform. The initial NSWindow bounds also needs to consider this logic, so bounds setting for Widgets that specify InitParams::bounds changes to use SetBounds(). A TODO that checked for a valid (according to OSX) window size there is resolved by adding a DCHECK to BridgedNativeWidget::SetBounds(). - Gets the following unit tests passing on MacViews: DesktopScreenPositionClientTest.PositionDialog DesktopScreenPositionClientTest.PositionControlWithNonRootParent BUG=378134 Committed: https://crrev.com/ff4479f1e616d7fc5af1355201614a5b333bcd03 Cr-Commit-Position: refs/heads/master@{#317967}

Patch Set 1 #

Patch Set 2 : OK on Mac but.. not elsewhere #

Patch Set 3 : found some existing unittests #

Patch Set 4 : fix gn #

Patch Set 5 : Use kWindowSizeDeterminedLater #

Total comments: 2

Patch Set 6 : Use GetAuraWindowTypeForWidgetType #

Patch Set 7 : Added comment to BridgedNativeWidget #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -119 lines) Patch
M ui/views/BUILD.gn View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.h View 1 2 3 4 5 6 2 chunks +7 lines, -1 line 0 comments Download
M ui/views/cocoa/bridged_native_widget.mm View 1 2 3 4 5 5 chunks +39 lines, -2 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget_unittest.mm View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/views.gyp View 1 2 3 4 5 chunks +7 lines, -7 lines 0 comments Download
D ui/views/widget/desktop_aura/desktop_screen_position_client_unittest.cc View 1 2 1 chunk +0 lines, -81 lines 0 comments Download
A + ui/views/widget/desktop_widget_unittest.cc View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M ui/views/widget/native_widget_mac.mm View 1 2 3 4 3 chunks +2 lines, -18 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 2 3 4 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 17 (6 generated)
tapted
Hi Andre, WDYT of this for fixing the positioning? (I nearly started calling these parented ...
5 years, 10 months ago (2015-02-23 07:42:34 UTC) #4
Andre
https://codereview.chromium.org/927233003/diff/120001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/927233003/diff/120001/ui/views/cocoa/bridged_native_widget.mm#newcode46 ui/views/cocoa/bridged_native_widget.mm:46: if (type == views::Widget::InitParams::TYPE_POPUP) The aura version of this ...
5 years, 10 months ago (2015-02-23 18:27:08 UTC) #5
tapted
https://codereview.chromium.org/927233003/diff/120001/ui/views/cocoa/bridged_native_widget.mm File ui/views/cocoa/bridged_native_widget.mm (right): https://codereview.chromium.org/927233003/diff/120001/ui/views/cocoa/bridged_native_widget.mm#newcode46 ui/views/cocoa/bridged_native_widget.mm:46: if (type == views::Widget::InitParams::TYPE_POPUP) On 2015/02/23 18:27:08, Andre wrote: ...
5 years, 10 months ago (2015-02-24 00:14:32 UTC) #6
Andre
LGTM
5 years, 10 months ago (2015-02-24 00:23:22 UTC) #7
tapted
+sky for ui/views OWNERS - please take a look note this adds ui/views/widget/desktop_widget_unittest.cc (moved from ...
5 years, 10 months ago (2015-02-24 00:51:59 UTC) #9
Andre
Can we add a comment for SetBounds in widget.h, documenting the expected coordinate space of ...
5 years, 10 months ago (2015-02-24 07:01:42 UTC) #10
sky
LGTM
5 years, 10 months ago (2015-02-24 16:57:14 UTC) #11
tapted
On 2015/02/24 07:01:42, Andre wrote: > Can we add a comment for SetBounds in widget.h, ...
5 years, 10 months ago (2015-02-25 01:50:07 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/927233003/160001
5 years, 10 months ago (2015-02-25 01:59:38 UTC) #15
commit-bot: I haz the power
Committed patchset #7 (id:160001)
5 years, 10 months ago (2015-02-25 03:22:53 UTC) #16
commit-bot: I haz the power
5 years, 10 months ago (2015-02-25 03:23:42 UTC) #17
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/ff4479f1e616d7fc5af1355201614a5b333bcd03
Cr-Commit-Position: refs/heads/master@{#317967}

Powered by Google App Engine
This is Rietveld 408576698