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

Issue 2415053002: MacViews: Support ui::MODAL_TYPE_WINDOW with a null parent window. (Closed)

Created:
4 years, 2 months ago by tapted
Modified:
4 years, 2 months ago
Reviewers:
msw
CC:
chromium-reviews, tfarina, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Support ui::MODAL_TYPE_WINDOW with a null parent window. It sounds weird, but other platforms support this. The window simply becomes unparented and isn't modal to anything. Currently NativeWidgetMac will DCHECK in void NativeWidgetMac:: InitModalType() and crash in BridgedNativeWidget::ShowAsModalSheet() when trying to attach the window to the parent as a dialog sheet. It's straightforward to ignore the modal type on Mac when no parent is given. A use case for this is when extensions need to surface a dialog (e.g. when permissions require upgrading). Usually there is a parent browser window, but sometimes there is not. For example, background pages or app shortcuts launched from the Windows desktop. Add a test case for constrained_window::CreateBrowserModalDialogViews() which is responsible for allowing this. There's an existing test -- ExtensionInstallPromptBrowserTest.NoParent -- but it doesn't have coverage for actually showing the Widget - only the plumbing that leads up to that step. BUG=647574 Committed: https://crrev.com/82c125e09e98ceefc99fef084d0653fc959b2a97 Cr-Commit-Position: refs/heads/master@{#426302}

Patch Set 1 #

Patch Set 2 : Allow context to be set #

Patch Set 3 : don't git-conflict with myself #

Total comments: 7

Patch Set 4 : review comments, desktop widgets, cite bug #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -7 lines) Patch
M components/constrained_window/constrained_window_views.h View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M components/constrained_window/constrained_window_views_unittest.cc View 1 2 3 3 chunks +75 lines, -1 line 0 comments Download
M ui/views/widget/native_widget_mac.mm View 1 2 2 chunks +10 lines, -4 lines 0 comments Download

Messages

Total messages: 34 (27 generated)
tapted
Hi Mike, please take a look. There is additional details/analysis in http://crbug.com/647574#c9 and #c10. Thanks!
4 years, 2 months ago (2016-10-18 07:42:37 UTC) #15
msw
I totally agree, this fix matches hacky behavior on other platforms that we should probably ...
4 years, 2 months ago (2016-10-18 23:47:15 UTC) #18
tapted
PTAL - staring at OnBeforeWidgetInit() for so long made me realise there's better coverage if ...
4 years, 2 months ago (2016-10-19 08:13:48 UTC) #24
msw
still lgtm; thanks! https://codereview.chromium.org/2415053002/diff/40001/components/constrained_window/constrained_window_views_unittest.cc File components/constrained_window/constrained_window_views_unittest.cc (right): https://codereview.chromium.org/2415053002/diff/40001/components/constrained_window/constrained_window_views_unittest.cc#newcode90 components/constrained_window/constrained_window_views_unittest.cc:90: if (!params->context) On 2016/10/19 08:13:48, tapted ...
4 years, 2 months ago (2016-10-19 19:02:07 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2415053002/100001
4 years, 2 months ago (2016-10-19 21:52:48 UTC) #30
commit-bot: I haz the power
Committed patchset #4 (id:100001)
4 years, 2 months ago (2016-10-19 22:11:10 UTC) #32
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:12:05 UTC) #34
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/82c125e09e98ceefc99fef084d0653fc959b2a97
Cr-Commit-Position: refs/heads/master@{#426302}

Powered by Google App Engine
This is Rietveld 408576698