New issue
Advanced search Search tips

Issue 823280 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 825875



Sign in to add a comment

Detect whether WebContents destructions was triggered by the user.

Project Member Reported by csharrison@chromium.org, Mar 19 2018

Issue description

Multiple project want some notion of "user initiated" tab/window closure.

e.g:
1. We want to collect metrics on spammy popups that users close right away
2. We want to use this for page load abort tracking (did the user close the page while it was loading?

Right now, this signal can be corrupted by script-initiated close (e.g. window.close()) or other non-user initiated close (extensions, background contents for offline, etc).

I *think* the best signal for this is logic flowing from browser_commands.cc (CloseWindow/CloseTab), but I'm not confident about Android.
 
Blocking: 825875
It looks like this exists already for tab-closing, see WebContents::GetClosedByUserGesture.

For windows, it's more complex than CloseWindow in BrowserCommands. Pressing the "x" to close button on desktop goes through views::Widget::Close / BrowserView::CanClose which makes it hard to thread "user initiated" through. Still, the existing heuristic may be good enough for a start.
Labels: Hotlist-DesktopUIToolingRequired Hotlist-DesktopUIChecked

Sign in to add a comment