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

Unified Diff: chrome/browser/gtk/constrained_window_gtk.cc

Issue 541056: Tab-modal dialog improvements:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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/gtk/constrained_window_gtk.h ('k') | chrome/browser/gtk/tabs/tab_renderer_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/gtk/constrained_window_gtk.h ('k') | chrome/browser/gtk/tabs/tab_renderer_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698