| OLD | NEW |
| (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 |
| OLD | NEW |