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

Issue 1354873002: Mac: Prevent mouse events reaching subviews while a window has an attached Sheet (Closed)

Created:
5 years, 3 months ago by tapted
Modified:
4 years, 6 months ago
Reviewers:
Robert Sesek
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, Robert Sesek
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Prevent mouse events reaching subviews while a window has an attached Sheet It's currently possible to show a context menu for just about anything in Chrome while the window has a modal sheet displayed (the exception is the tab strip, which has a check in -[TabView menu]). This makes all sorts of weird stuff possible, like showing a `Print` dialog for the webcontents over the supposedly modal `Edit bookmark` dialog. To fix, have the shared (and mostly boring) ancestor view, class FastResizeView, override -[NSView hitTest:] to return itself when the window has an attached sheet. This nerfs the context menus. (note: zoom still works: that's handled by -[NSWindow sendEvent:] and seems to do separate hit-testing when a sheet is displayed). The TabStrip is in the titlebar, not a subview of FastResizeView, so it also needs to check. This makes the check in -[TabView menu] obsolete. We can't check "higher up" since the buttons in the window frame should behave as before. Note the mainMenu still functions as before. So a print dialog can still be displayed. Just not via a context menu. BUG=528871, 617895 TEST=Right-click the bookmarks toolbar and open a modal dialog (e.g. Edit..., Add Page..., Add Folder...). Then: - Right-clicking in the omnibox,tab strip or elsewhere shouldn't show a context menu. - Middle-clicking shouldn't close a tab. Committed: https://crrev.com/ceec40ad0ad238b6e37d1c18f478cee122b353b0 Cr-Commit-Position: refs/heads/master@{#400621}

Patch Set 1 #

Patch Set 2 : rebase? it's been a while #

Patch Set 3 : TabView menu check now obsolete #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -5 lines) Patch
M chrome/browser/ui/cocoa/fast_resize_view.mm View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_strip_view.mm View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_view.mm View 1 2 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 19 (9 generated)
tapted
Hi Robert, WDYT? I can't decide whether this is a hack or not.. Strangely, there's ...
5 years, 3 months ago (2015-09-18 05:58:20 UTC) #2
Robert Sesek
On 2015/09/18 05:58:20, tapted wrote: > Hi Robert, WDYT? I can't decide whether this is ...
5 years, 3 months ago (2015-09-21 21:52:54 UTC) #3
tapted
Hi Robert - PTAL - I've also added a check to TabStripView to fix http://crbug.com/617895 ...
4 years, 6 months ago (2016-06-10 06:43:48 UTC) #7
tapted
Hi Robert - PTAL - I've also added a check to TabStripView to fix http://crbug.com/617895 ...
4 years, 6 months ago (2016-06-10 06:45:40 UTC) #10
Robert Sesek
I think this makes sense to me, but why return self instead of nil for ...
4 years, 6 months ago (2016-06-13 22:36:27 UTC) #11
tapted
On 2016/06/13 22:36:27, Robert Sesek wrote: > I think this makes sense to me, but ...
4 years, 6 months ago (2016-06-16 05:16:21 UTC) #12
Robert Sesek
A someone hesitant LGTM :)
4 years, 6 months ago (2016-06-17 20:55:39 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1354873002/40001
4 years, 6 months ago (2016-06-20 00:19:46 UTC) #15
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 6 months ago (2016-06-20 01:03:52 UTC) #17
commit-bot: I haz the power
4 years, 6 months ago (2016-06-20 01:08:28 UTC) #19
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/ceec40ad0ad238b6e37d1c18f478cee122b353b0
Cr-Commit-Position: refs/heads/master@{#400621}

Powered by Google App Engine
This is Rietveld 408576698