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

Issue 2629593005: MacViews: Support -[NSWindow close] on sheets. (Closed)

Created:
3 years, 11 months ago by tapted
Modified:
3 years, 11 months ago
Reviewers:
Robert Sesek
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Support -[NSWindow close] on sheets. Usually a sheet is closed with a call to endSheet:, which blocks the UI thread to run the close animation, then runs the didEndSelector passed to -[NSApp beginSheet:..]. Calling -[NSWindow close] bypasses this and shouldn't be used. However, there are times where we need to close a sheet more violently. E.g.: When -[NSWindow close] is invoked on the parent window currently hosting a sheet, or during a dialog test that wants to invoke the synchronous Widget::CloseNow() rather than asynchronous Widget::Close(). Attempts to do this used to DCHECK(). Now, support -[NSWindow close] of a sheet by posting a task to -[NSWindow endSheet:] on the parent when the sheet is closed. This has tricky lifetime implications, but is necessary to ensure the modal session on the parent window is unblocked. BUG=681049 Review-Url: https://codereview.chromium.org/2629593005 Cr-Commit-Position: refs/heads/master@{#443718} Committed: https://chromium.googlesource.com/chromium/src/+/caeaf7c8f5c0daf2db7fd1a0dad1828dac26d62c

Patch Set 1 #

Patch Set 2 : Fix lifetime #

Total comments: 7

Patch Set 3 : Test show failure #

Total comments: 1

Patch Set 4 : no doNothing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -6 lines) Patch
M ui/views/cocoa/views_nswindow_delegate.mm View 1 2 3 3 chunks +31 lines, -1 line 0 comments Download
M ui/views/cocoa/widget_owner_nswindow_adapter.mm View 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/widget/native_widget_mac.mm View 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/widget/native_widget_mac_unittest.mm View 1 2 2 chunks +57 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (18 generated)
tapted
Hi Robert, please take a look https://codereview.chromium.org/2629593005/diff/20001/ui/views/widget/native_widget_mac.mm File ui/views/widget/native_widget_mac.mm (left): https://codereview.chromium.org/2629593005/diff/20001/ui/views/widget/native_widget_mac.mm#oldcode385 ui/views/widget/native_widget_mac.mm:385: // Cocoa ignores ...
3 years, 11 months ago (2017-01-13 19:36:53 UTC) #9
Robert Sesek
lgtm w/ two questions https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm File ui/views/cocoa/views_nswindow_delegate.mm (right): https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm#newcode95 ui/views/cocoa/views_nswindow_delegate.mm:95: // Does nothing: Used to ...
3 years, 11 months ago (2017-01-13 20:02:48 UTC) #10
tapted
https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm File ui/views/cocoa/views_nswindow_delegate.mm (right): https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm#newcode95 ui/views/cocoa/views_nswindow_delegate.mm:95: // Does nothing: Used to force |self| to be ...
3 years, 11 months ago (2017-01-13 20:52:51 UTC) #14
Robert Sesek
LGTM, take or leave the suggestion https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm File ui/views/cocoa/views_nswindow_delegate.mm (right): https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm#newcode95 ui/views/cocoa/views_nswindow_delegate.mm:95: // Does nothing: ...
3 years, 11 months ago (2017-01-13 21:46:01 UTC) #18
tapted
https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm File ui/views/cocoa/views_nswindow_delegate.mm (right): https://codereview.chromium.org/2629593005/diff/20001/ui/views/cocoa/views_nswindow_delegate.mm#newcode95 ui/views/cocoa/views_nswindow_delegate.mm:95: // Does nothing: Used to force |self| to be ...
3 years, 11 months ago (2017-01-13 22:32:45 UTC) #19
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/2629593005/60001
3 years, 11 months ago (2017-01-13 22:33:31 UTC) #22
commit-bot: I haz the power
3 years, 11 months ago (2017-01-13 23:21:58 UTC) #25
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/caeaf7c8f5c0daf2db7fd1a0dad1...

Powered by Google App Engine
This is Rietveld 408576698