Chromium Code Reviews| 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..3a761fe6a3caabfdd6ad2389a0f75c3a66eb307e 100644 |
| --- a/chrome/browser/ui/panels/panel_view.cc |
| +++ b/chrome/browser/ui/panels/panel_view.cc |
| @@ -286,12 +286,26 @@ 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()) { |
|
jianli
2012/09/19 01:09:43
nit: could you please add comment for why we need
jennb
2012/09/19 01:16:46
Done. Stole wording from browser_view.cc
|
| + // When web contents are destroyed, we will be called back again. |
| + panel_->OnWindowClosing(); |
| + return; |
| + } |
| + |
| panel_->OnNativePanelClosed(); |
| window_->Close(); |
| + window_ = NULL; |
| } |
| void PanelView::ActivatePanel() { |