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

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

Issue 164547: Mac: make save/open dialogs operate as tab-modal sheets.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Painfully (but hopefully correctly) merged ToT. Created 11 years, 2 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/tab_contents_controller_view.mm ('k') | chrome/browser/cocoa/toolbar_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_strip_controller.mm
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index 2f10f27e9c06d0dee03d346d3a807170a6a4c330..5cd69cf06fb7f0ea4fc8949878b3b567a7a6e87e 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -194,6 +194,10 @@ static const float kIndentLeavingSpaceForControls = 64.0;
// Make sure the new tabs's sheets are visible (necessary when a background
// tab opened a sheet while it was in the background and now becomes active).
+ // TODO(viettrungluu@gmail.com): Directly iterating over the |TabContents|'s
+ // (essentially internal, private) list isn't great -- I'd like to get rid of
+ // this and somehow move it into |TabContents| itself (or provide a cleaner
+ // interface).
TabContents* newTab = tabModel_->GetTabContentsAt(index);
DCHECK(newTab);
if (newTab) {
@@ -959,7 +963,17 @@ static const float kIndentLeavingSpaceForControls = 64.0;
// to pass it to the sheet controller here.
NSView* tabContentsView =
[[window->owner()->GetNativeView() superview] superview];
- window->delegate()->RunSheet([self sheetController], tabContentsView);
+ SEL frameSelector = nil;
+ SEL positionSelector = nil;
+ if (window->delegate()->GetModalityLevel() >=
+ ConstrainedWindow::kModalForTab) {
+ frameSelector = @selector(frameWithBars);
+ positionSelector = @selector(positionSheetBelowToolbar:usingRect:);
+ }
+ window->delegate()->RunSheet([self sheetController],
+ tabContentsView,
+ frameSelector,
+ positionSelector);
// TODO(avi, thakis): GTMWindowSheetController has no api to move tabsheets
// between windows. Until then, we have to prevent having to move a tabsheet
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller_view.mm ('k') | chrome/browser/cocoa/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698