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

Side by Side Diff: chrome/browser/cocoa/tab_contents_controller_view.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "chrome/browser/cocoa/tab_contents_controller_view.h"
6
7 #include "base/logging.h"
8 #import "chrome/browser/cocoa/browser_window_controller.h"
9
10 @implementation TabContentsControllerView
11
12 - (CGFloat)toolbarHeight {
13 if ([self superview]) {
14 BrowserWindowController* controller = [[self window] windowController];
15 DCHECK([controller isKindOfClass:[BrowserWindowController class]]);
16 NSRect frame = [[[controller toolbarController] view] frame];
17 return frame.size.height;
18 }
19
20 NOTREACHED();
21 return 0.0;
22 }
23
24 - (CGFloat)infobarsHeight {
25 if ([self superview]) {
26 BrowserWindowController* controller = [[self window] windowController];
27 DCHECK([controller isKindOfClass:[BrowserWindowController class]]);
28 NSRect frame = [[[controller infoBarContainerController] view] frame];
29 return frame.size.height;
30 }
31
32 NOTREACHED();
33 return 0.0;
34 }
35
36 - (NSRect)frameWithBars {
37 // Extra height *above*.
38 CGFloat extra_height = [self toolbarHeight] + [self infobarsHeight];
39
40 NSRect frame = [self frame];
41 frame.size.height += extra_height;
42 if ([[self superview] isFlipped])
43 frame.origin.y -= extra_height;
44 return frame;
45 }
46
47 - (NSRect)positionSheetBelowToolbar:(NSWindow *)sheet
48 usingRect:(NSRect)defaultSheetRect {
49 defaultSheetRect.origin.y -= [self toolbarHeight];
50 return defaultSheetRect;
51 }
52
53 @end // @implementation TabContentsControllerView
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller_view.h ('k') | chrome/browser/cocoa/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698