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

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

Issue 392018: Enforce that only one constrained window is displayed at once per tab. (Closed)
Patch Set: Set focus correctly on linux Created 11 years, 1 month 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/login_prompt_gtk.cc » ('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
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);
« no previous file with comments | « chrome/browser/gtk/constrained_window_gtk.h ('k') | chrome/browser/login_prompt_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698