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

Unified Diff: chrome/browser/cocoa/constrained_window_mac.mm

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/cocoa/constrained_window_mac.h ('k') | chrome/browser/gtk/constrained_window_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/constrained_window_mac.mm
diff --git a/chrome/browser/cocoa/constrained_window_mac.mm b/chrome/browser/cocoa/constrained_window_mac.mm
index ed5cba0cd897ad76e928396b545193e8899106a9..5670dabc8dad5f352efdbc9481b88686a077d4ff 100644
--- a/chrome/browser/cocoa/constrained_window_mac.mm
+++ b/chrome/browser/cocoa/constrained_window_mac.mm
@@ -46,9 +46,16 @@ ConstrainedWindowMac::ConstrainedWindowMac(
TabContents* owner, ConstrainedWindowMacDelegate* delegate)
: owner_(owner),
delegate_(delegate),
- controller_(nil) {
+ controller_(nil),
+ should_be_visible_(false) {
DCHECK(owner);
DCHECK(delegate);
+}
+
+ConstrainedWindowMac::~ConstrainedWindowMac() {}
+
+void ConstrainedWindowMac::ShowConstrainedWindow() {
+ should_be_visible_ = true;
// The TabContents only has a native window if it is currently visible. In
// this case, open the sheet now. Else, Realize() will be called later, when
@@ -61,8 +68,6 @@ ConstrainedWindowMac::ConstrainedWindowMac(
}
}
-ConstrainedWindowMac::~ConstrainedWindowMac() {}
-
void ConstrainedWindowMac::CloseConstrainedWindow() {
// Note: controller_ can be `nil` here if the sheet was never realized. That's
// ok.
@@ -74,6 +79,9 @@ void ConstrainedWindowMac::CloseConstrainedWindow() {
}
void ConstrainedWindowMac::Realize(BrowserWindowController* controller) {
+ if (!should_be_visible_)
+ return;
+
if (controller_ != nil) {
DCHECK(controller_ == controller);
return;
« no previous file with comments | « chrome/browser/cocoa/constrained_window_mac.h ('k') | chrome/browser/gtk/constrained_window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698