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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 219032: Mac: Sheets should be positioned between the content and everything above it. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <Carbon/Carbon.h> 5 #include <Carbon/Carbon.h>
6 6
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/scoped_nsdisable_screen_updates.h" 8 #include "base/scoped_nsdisable_screen_updates.h"
9 #import "base/scoped_nsobject.h" 9 #import "base/scoped_nsobject.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 windowPreferences->SetInteger(L"top", bounds.y()); 1148 windowPreferences->SetInteger(L"top", bounds.y());
1149 windowPreferences->SetInteger(L"right", bounds.right()); 1149 windowPreferences->SetInteger(L"right", bounds.right());
1150 windowPreferences->SetInteger(L"bottom", bounds.bottom()); 1150 windowPreferences->SetInteger(L"bottom", bounds.bottom());
1151 windowPreferences->SetBoolean(L"maximized", false); 1151 windowPreferences->SetBoolean(L"maximized", false);
1152 windowPreferences->SetBoolean(L"always_on_top", false); 1152 windowPreferences->SetBoolean(L"always_on_top", false);
1153 } 1153 }
1154 1154
1155 - (NSRect)window:(NSWindow*)window 1155 - (NSRect)window:(NSWindow*)window
1156 willPositionSheet:(NSWindow*)sheet 1156 willPositionSheet:(NSWindow*)sheet
1157 usingRect:(NSRect)defaultSheetRect { 1157 usingRect:(NSRect)defaultSheetRect {
1158 NSRect windowFrame = [window frame]; 1158 // Any sheet should come from right above the visible content area.
1159 defaultSheetRect.origin.y = windowFrame.size.height - 10; 1159 NSRect toolbarFrame = [[toolbarController_ view] frame];
1160 NSRect infobarFrame = [[infoBarContainerController_ view] frame];
1161 defaultSheetRect.origin.y = toolbarFrame.origin.y - infobarFrame.size.height;
1162
1160 return defaultSheetRect; 1163 return defaultSheetRect;
1161 } 1164 }
1162 1165
1163 // In addition to the tab strip and content area, which the superview's impl 1166 // In addition to the tab strip and content area, which the superview's impl
1164 // takes care of, we need to add the toolbar and bookmark bar to the 1167 // takes care of, we need to add the toolbar and bookmark bar to the
1165 // overlay so they draw correctly when dragging out a new window. 1168 // overlay so they draw correctly when dragging out a new window.
1166 - (NSArray*)viewsToMoveToOverlay { 1169 - (NSArray*)viewsToMoveToOverlay {
1167 NSArray* views = [super viewsToMoveToOverlay]; 1170 NSArray* views = [super viewsToMoveToOverlay];
1168 NSArray* browserViews = 1171 NSArray* browserViews =
1169 [NSArray arrayWithObjects:[toolbarController_ view], 1172 [NSArray arrayWithObjects:[toolbarController_ view],
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 provider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR); 1420 provider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR);
1418 [theme setValue:toolbarBackgroundColor 1421 [theme setValue:toolbarBackgroundColor
1419 forAttribute:@"backgroundColor" 1422 forAttribute:@"backgroundColor"
1420 style:GTMThemeStyleToolBar 1423 style:GTMThemeStyleToolBar
1421 state:GTMThemeStateActiveWindow]; 1424 state:GTMThemeStateActiveWindow];
1422 1425
1423 return theme; 1426 return theme;
1424 } 1427 }
1425 @end 1428 @end
1426 1429
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698