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

Issue 19209002: Fix Download In Progress prompt on browser close (regression) (Closed)

Created:
7 years, 5 months ago by benjhayden
Modified:
7 years, 5 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Fix Download In Progress prompt on browser close (regression) Before reviewing, please read this brief history of the is_attempting_to_close_browser_ branch. https://chromiumcodereview.appspot.com/10749002 12 months ago by Ben Goodger Before this CL, is_attempting_to_close_browser_ was set to true in ShouldCloseWindow() *after* CanCloseWithInProgressDownloads() was called, so that the `if (is_attempting_to_close_browser_)return...` branch in OkToCloseWithInProgressDownloads() would only be taken while the Download In Progress dialog is displaying. After this CL, UnloadController::is_attempting_to_close_browser_ is set to true in TabStripEmpty(), which is called *before* ShouldCloseWindow(), so that the is_attempting_to_close_browser_ branch in OkToCloseWithInProgressDownloads() would *always* (or perhaps just more often?) be taken. https://codereview.chromium.org/7466033 23 months ago by Randy This CL moved the `if (is_attempting_to_close_browser_) return...` branch from CanCloseWithInProgressDownloads() to its current location in OkToCloseWithInProgressDownloads(). This branch was not documented either before or after this CL. https://codereview.chromium.org/1654011 39 months ago by georgey This CL adds the is_attempting_to_close_browser_ branch to CanCloseWithInProgressDownloads(). In this revision, that flag is only true between ShouldCloseWindow() (after CanCloseWithInProgressDownloads() has a chance to prevent the window from closing) and CancelWindowClose(), so it seems that the intended purpose of the branch is to make CanCloseWithInProgressDownloads() return true while the Download In Progress dialog is displaying. Why should CanCloseWithInProgressDownloads() return true while the Download In Progress dialog is displaying? How could it be called, if there's a modal dialog preventing the user from interacting with the browser? Even if it can be called from javascript or somewhere else, wouldn't it be acceptable to close the browser if all downloads are complete without waiting for the user to deal with the dialog? I'm happy to find another way to make OkToCloseWithInProgressDownloads() return OK while the Download In Progress dialog is displaying if there's a reason for it. This might be a liberal interpretation of the 'when in doubt, rip it out' philosophy, but I don't think it is. PS1@r211430 BUG=153294 R=asanka@chromium.org, ben@chromium.org, rdsmith@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=212403

Patch Set 1 #

Patch Set 2 : @r212340 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -4 lines) Patch
M chrome/browser/ui/browser.cc View 1 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
benjhayden
Please read the issue description before reviewing. Thanks!
7 years, 5 months ago (2013-07-15 15:54:54 UTC) #1
Randy Smith (Not in Mondays)
Nice archaeology! I suspect that there was some re-entrant exit path that is/was called if ...
7 years, 5 months ago (2013-07-15 22:42:55 UTC) #2
asanka
LGTM The is_attempting_to_close_browser logic was refactored again in https://chromiumcodereview.appspot.com/17571018/. Also CanCloseWithInProgressDownloads() should return false while ...
7 years, 5 months ago (2013-07-16 17:41:46 UTC) #3
benjhayden
On 2013/07/16 17:41:46, asanka wrote: > LGTM > > The is_attempting_to_close_browser logic was refactored again ...
7 years, 5 months ago (2013-07-16 18:12:38 UTC) #4
Ben Goodger (Google)
I think it's fair to say that no one understands this now better than you ...
7 years, 5 months ago (2013-07-17 20:46:42 UTC) #5
benjhayden
On 2013/07/17 20:46:42, Ben Goodger (Google) wrote: > I think it's fair to say that ...
7 years, 5 months ago (2013-07-17 20:47:59 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/19209002/20001
7 years, 5 months ago (2013-07-18 14:00:36 UTC) #7
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=177275
7 years, 5 months ago (2013-07-18 17:41:41 UTC) #8
benjhayden
7 years, 5 months ago (2013-07-18 19:45:06 UTC) #9
Message was sent while issue was closed.
Committed patchset #2 manually as r212403 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698