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

Unified Diff: chrome/browser/tab_contents/tab_contents.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/tab_contents/tab_contents.h ('k') | chrome/browser/tab_contents/tab_contents_view_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 0d2ba960bdf1286b2d74be3f88f1df38e7468d37..16c2637ef9e129b535f593b0352cbaa65d19a116 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -824,6 +824,10 @@ ConstrainedWindow* TabContents::CreateConstrainedDialog(
ConstrainedWindow* window =
ConstrainedWindow::CreateConstrainedDialog(this, delegate);
child_windows_.push_back(window);
+
+ if (child_windows_.size() == 1)
+ window->ShowConstrainedWindow();
+
return window;
}
@@ -1054,8 +1058,13 @@ void TabContents::OnStartDownload(DownloadItem* download) {
void TabContents::WillClose(ConstrainedWindow* window) {
ConstrainedWindowList::iterator it =
find(child_windows_.begin(), child_windows_.end(), window);
+
+ bool removed_topmost_window = it == child_windows_.begin();
if (it != child_windows_.end())
child_windows_.erase(it);
+
+ if (removed_topmost_window && child_windows_.size() > 0)
+ child_windows_[0]->ShowConstrainedWindow();
}
void TabContents::WillCloseBlockedPopupContainer(
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/tab_contents/tab_contents_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698