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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.mm

Issue 12594015: Alternate NTP Mac: Push down overlay in presentation mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
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);

Powered by Google App Engine
This is Rietveld 408576698