Index: chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm |
diff --git a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm |
index 786b0766841137d425663cf234ce4e9f21530641..634f456f716cf5e94946e3639863ae0349947c85 100644 |
--- a/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm |
+++ b/chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm |
@@ -22,6 +22,7 @@ |
@synthesize drawDropShadow = drawDropShadow_; |
@synthesize activeContainerOffset = activeContainerOffset_; |
+@synthesize overlayContentsOffset = overlayContentsOffset_; |
- (id)initWithBrowser:(Browser*)browser |
windowController:(BrowserWindowController*)windowController { |
@@ -145,6 +146,14 @@ |
[self layoutViews]; |
} |
+- (void)setOverlayContentsOffset:(CGFloat)overlayContentsOffset { |
+ if (overlayContentsOffset_ == overlayContentsOffset) |
+ return; |
+ |
+ overlayContentsOffset_ = overlayContentsOffset; |
+ [self layoutViews]; |
+} |
+ |
- (void)viewDidResize:(NSNotification*)note { |
[self layoutViews]; |
} |
@@ -165,8 +174,8 @@ |
if (overlayContents_) { |
NSRect overlayFrame = bounds; |
overlayFrame.size.height = [self overlayHeightInPixels]; |
- overlayFrame.origin.y = |
- NSMinY([topSeparatorView_ frame]) - NSHeight(overlayFrame); |
+ overlayFrame.origin.y = NSMinY([topSeparatorView_ frame]) - |
+ NSHeight(overlayFrame) - overlayContentsOffset_; |
[overlayContents_->GetView()->GetNativeView() setFrame:overlayFrame]; |
if (dropShadowView_) { |
@@ -192,8 +201,8 @@ |
} |
- (CGFloat)overlayHeightInPixels { |
- CGFloat height = |
- NSHeight([[self view] bounds]) - NSHeight([topSeparatorView_ frame]); |
+ CGFloat height = NSHeight([[self view] bounds]) - |
+ NSHeight([topSeparatorView_ frame]) - overlayContentsOffset_; |
switch (overlayHeightUnits_) { |
case INSTANT_SIZE_PERCENT: |
return std::min(height, (height * overlayHeight_) / 100); |