| Index: chrome/browser/gtk/constrained_window_gtk.cc
|
| ===================================================================
|
| --- chrome/browser/gtk/constrained_window_gtk.cc (revision 36364)
|
| +++ chrome/browser/gtk/constrained_window_gtk.cc (working copy)
|
| @@ -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 @@
|
| 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);
|
|
|
|
|