| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/cocoa/constrained_window_mac.h" | 5 #include "chrome/browser/cocoa/constrained_window_mac.h" |
| 6 | 6 |
| 7 #import "chrome/browser/cocoa/browser_window_controller.h" | 7 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents_view.h" | 9 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 10 #import "third_party/GTM/AppKit/GTMWindowSheetController.h" | 10 #import "third_party/GTM/AppKit/GTMWindowSheetController.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 void ConstrainedWindowMac::Realize(BrowserWindowController* controller) { | 76 void ConstrainedWindowMac::Realize(BrowserWindowController* controller) { |
| 77 if (controller_ != nil) { | 77 if (controller_ != nil) { |
| 78 DCHECK(controller_ == controller); | 78 DCHECK(controller_ == controller); |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 DCHECK(controller != nil); | 81 DCHECK(controller != nil); |
| 82 | 82 |
| 83 // Remember the controller we're adding ourselves to, so that we can later | 83 // Remember the controller we're adding ourselves to, so that we can later |
| 84 // remove us from it. | 84 // remove us from it. |
| 85 controller_ = controller; | 85 if ([controller attachConstrainedWindow:this]) |
| 86 [controller_ attachConstrainedWindow:this]; | 86 controller_ = controller; |
| 87 } |
| 88 |
| 89 void ConstrainedWindowMac::SetVisible() { |
| 90 // Only notify the delegate that the sheet is open after the sheet appeared |
| 91 // on screen (as opposed to when the sheet was added to the current tab's |
| 92 // sheet queue). |
| 87 delegate_->set_sheet_open(true); | 93 delegate_->set_sheet_open(true); |
| 88 } | 94 } |
| OLD | NEW |