Index: chrome/browser/gtk/constrained_window_gtk.cc |
diff --git a/chrome/browser/gtk/constrained_window_gtk.cc b/chrome/browser/gtk/constrained_window_gtk.cc |
index 1f53a59efde8a95094a0a98c260f1a1380a19ada..c6380d675e9fd052627ced8365d74393ea077c6b 100644 |
--- a/chrome/browser/gtk/constrained_window_gtk.cc |
+++ b/chrome/browser/gtk/constrained_window_gtk.cc |
@@ -11,7 +11,8 @@ |
ConstrainedWindowGtk::ConstrainedWindowGtk( |
TabContents* owner, ConstrainedWindowGtkDelegate* delegate) |
: owner_(owner), |
- delegate_(delegate) { |
+ delegate_(delegate), |
+ visible_(false) { |
DCHECK(owner); |
DCHECK(delegate); |
GtkWidget* dialog = delegate->GetWidgetRoot(); |
@@ -29,20 +30,25 @@ ConstrainedWindowGtk::ConstrainedWindowGtk( |
gtk_container_add(GTK_CONTAINER(frame), alignment); |
gtk_container_add(GTK_CONTAINER(ebox), frame); |
border_.Own(ebox); |
+} |
+ |
+ConstrainedWindowGtk::~ConstrainedWindowGtk() { |
+ border_.Destroy(); |
+} |
+void ConstrainedWindowGtk::ShowConstrainedWindow() { |
gtk_widget_show_all(border_.get()); |
// We collaborate with TabContentsViewGtk and stick ourselves in the |
// TabContentsViewGtk's floating container. |
ContainingView()->AttachConstrainedWindow(this); |
-} |
-ConstrainedWindowGtk::~ConstrainedWindowGtk() { |
- border_.Destroy(); |
+ visible_ = true; |
} |
void ConstrainedWindowGtk::CloseConstrainedWindow() { |
- ContainingView()->RemoveConstrainedWindow(this); |
+ if (visible_) |
+ ContainingView()->RemoveConstrainedWindow(this); |
delegate_->DeleteDelegate(); |
owner_->WillClose(this); |