| Index: chrome/browser/ui/panels/panel_view.cc
|
| diff --git a/chrome/browser/ui/panels/panel_view.cc b/chrome/browser/ui/panels/panel_view.cc
|
| index d4f348daea194e660cc1fce6b6842cf900c59c33..a6a1cfe9a27594d0f217dce8c972201ca22a20af 100644
|
| --- a/chrome/browser/ui/panels/panel_view.cc
|
| +++ b/chrome/browser/ui/panels/panel_view.cc
|
| @@ -286,12 +286,27 @@ void PanelView::AnimationProgressed(const ui::Animation* animation) {
|
| }
|
|
|
| void PanelView::ClosePanel() {
|
| + // We're already closing. Do nothing.
|
| + if (!window_)
|
| + return;
|
| +
|
| + if (!panel_->ShouldCloseWindow())
|
| + return;
|
| +
|
| // Cancel any currently running animation since we're closing down.
|
| if (bounds_animator_.get())
|
| bounds_animator_.reset();
|
|
|
| + if (panel_->GetWebContents()) {
|
| + // Still have web contents. Allow renderer to shut down.
|
| + // When web contents are destroyed, we will be called back again.
|
| + panel_->OnWindowClosing();
|
| + return;
|
| + }
|
| +
|
| panel_->OnNativePanelClosed();
|
| window_->Close();
|
| + window_ = NULL;
|
| }
|
|
|
| void PanelView::ActivatePanel() {
|
|
|