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

Issue 6247002: chromeos: Run beforeunload handlers when closing panels. (Closed)

Created:
9 years, 11 months ago by Daniel Erat
Modified:
9 years, 7 months ago
Reviewers:
oshima, DaveMoore
CC:
chromium-reviews, davemoore+watch_chromium.org, stevenjb
Visibility:
Public.

Description

chromeos: Run beforeunload handlers when closing panels. When a panel content window has a beforeunload handler, we'd previously close its titlebar (which would cause the window manager to also hide the content window in anticipation of it being closed too), but then leave the content window mapped and open a modal dialog (which would be kept invisible by the window manager). This would effectively freeze the UI unless the user happened to press the Escape key, which would still leave us in a state where we'd end up restoring the panel again the next time the session was restored. This change makes us instead call BrowserView::CanClose() first and avoid closing the panel if we're not supposed to. BUG=chromium-os:10910 TEST=went to air1.com/listen and checked that i get an alert when closing the panel with "leave this page" and "stay on this page" buttons that function as expected Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71363

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -2 lines) Patch
M chrome/browser/chromeos/frame/panel_browser_view.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/frame/panel_browser_view.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/frame/panel_controller.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/frame/panel_controller.cc View 1 chunk +4 lines, -1 line 2 comments Download
M chrome/browser/chromeos/notifications/notification_panel.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/notifications/notification_panel.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Daniel Erat
9 years, 11 months ago (2011-01-13 03:44:15 UTC) #1
DaveMoore
LGTM
9 years, 11 months ago (2011-01-13 20:48:48 UTC) #2
oshima
http://codereview.chromium.org/6247002/diff/1/chrome/browser/chromeos/frame/panel_controller.cc File chrome/browser/chromeos/frame/panel_controller.cc (right): http://codereview.chromium.org/6247002/diff/1/chrome/browser/chromeos/frame/panel_controller.cc#newcode310 chrome/browser/chromeos/frame/panel_controller.cc:310: if (!delegate_->CanClosePanel()) This may not be the scope of ...
9 years, 11 months ago (2011-01-13 21:18:11 UTC) #3
Daniel Erat
http://codereview.chromium.org/6247002/diff/1/chrome/browser/chromeos/frame/panel_controller.cc File chrome/browser/chromeos/frame/panel_controller.cc (right): http://codereview.chromium.org/6247002/diff/1/chrome/browser/chromeos/frame/panel_controller.cc#newcode310 chrome/browser/chromeos/frame/panel_controller.cc:310: if (!delegate_->CanClosePanel()) On 2011/01/13 21:18:12, oshima wrote: > This ...
9 years, 11 months ago (2011-01-13 21:26:34 UTC) #4
oshima
9 years, 11 months ago (2011-01-13 21:31:14 UTC) #5
On Thu, Jan 13, 2011 at 1:26 PM, <derat@chromium.org> wrote:

>
>
>
http://codereview.chromium.org/6247002/diff/1/chrome/browser/chromeos/frame/p...
> File chrome/browser/chromeos/frame/panel_controller.cc (right):
>
>
>
http://codereview.chromium.org/6247002/diff/1/chrome/browser/chromeos/frame/p...
> chrome/browser/chromeos/frame/panel_controller.cc:310: if
> (!delegate_->CanClosePanel())
> On 2011/01/13 21:18:12, oshima wrote:
>
>> This may not be the scope of this CL, but wouldn't it be better to
>>
> give visual
>
>> feedback that a user can't close the panel?
>>
>
> In the case of a beforeunload handler, a modal dialog is opened.


Got it .thank you for clarification.




>
> http://codereview.chromium.org/6247002/
>

Powered by Google App Engine
This is Rietveld 408576698