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

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

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/cocoa/constrained_window_mac.h ('k') | chrome/browser/cocoa/tab_strip_controller.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
===================================================================
--- chrome/browser/cocoa/constrained_window_mac.mm (revision 36364)
+++ chrome/browser/cocoa/constrained_window_mac.mm (working copy)
@@ -46,10 +46,16 @@
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
// our tab becomes visible.
@@ -61,8 +67,6 @@
}
}
-ConstrainedWindowMac::~ConstrainedWindowMac() {}
-
void ConstrainedWindowMac::CloseConstrainedWindow() {
// Note: controller_ can be `nil` here if the sheet was never realized. That's
// ok.
@@ -74,6 +78,9 @@
}
void ConstrainedWindowMac::Realize(BrowserWindowController* controller) {
+ if (!should_be_visible_)
+ return;
+
if (controller_ != nil) {
DCHECK(controller_ == controller);
return;
@@ -82,13 +89,7 @@
// Remember the controller we're adding ourselves to, so that we can later
// remove us from it.
- if ([controller attachConstrainedWindow:this])
- controller_ = controller;
-}
-
-void ConstrainedWindowMac::SetVisible() {
- // Only notify the delegate that the sheet is open after the sheet appeared
- // on screen (as opposed to when the sheet was added to the current tab's
- // sheet queue).
+ controller_ = controller;
+ [controller_ attachConstrainedWindow:this];
delegate_->set_sheet_open(true);
}
Property changes on: chrome\browser\cocoa\constrained_window_mac.mm
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/cocoa/constrained_window_mac.h ('k') | chrome/browser/cocoa/tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698