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

Unified Diff: chrome/browser/ui/panels/panel_view.cc

Issue 10948027: [Panels] Fix browser crash when killing extension on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/panel_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « chrome/browser/ui/panels/panel_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698