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

Unified Diff: chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm

Issue 7461134: [Mac] Unspoofable infobars v3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Rohit Created 9 years, 4 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/infobars/infobar_container_controller.mm
diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm
index 5c7346849aa51c49137999eca90afff45ff5d865..795a4141d8b6634932e884bed9dda23c4bddac26 100644
--- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm
+++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm
@@ -158,8 +158,8 @@ class InfoBarNotificationObserver : public NotificationObserver {
return [infobarControllers_ count] - [closingInfoBars_ count];
}
-- (CGFloat)antiSpoofHeight {
- return 0;
+- (CGFloat)overlappingTipHeight {
+ return [self infobarCount] ? infobars::kTipHeight : 0;
}
- (void)resizeView:(NSView*)view newHeight:(CGFloat)height {
@@ -180,8 +180,15 @@ class InfoBarNotificationObserver : public NotificationObserver {
- (CGFloat)desiredHeight {
CGFloat height = 0;
+
for (InfoBarController* controller in infobarControllers_.get())
rohitrao (ping after 24h) 2011/08/05 14:24:12 Add a comment reminding us that NSHeight(eachInfob
Robert Sesek 2011/08/05 15:10:40 Done.
- height += NSHeight([[controller view] frame]);
+ height += NSHeight([[controller view] frame]) - infobars::kTipHeight;
+
+ // If there's any infobars, add a little extra room for the tip of the first
rohitrao (ping after 24h) 2011/08/05 14:24:12 s/there's/there are/
Robert Sesek 2011/08/05 15:10:40 Done.
+ // infobar.
+ if (height)
+ height += infobars::kTipHeight;
+
return height;
}
@@ -243,7 +250,7 @@ class InfoBarNotificationObserver : public NotificationObserver {
frame.size.width = NSWidth(containerBounds);
[view setFrame:frame];
- minY += NSHeight(frame);
+ minY += NSHeight(frame) - infobars::kTipHeight;
}
[resizeDelegate_ resizeView:[self view] newHeight:[self desiredHeight]];

Powered by Google App Engine
This is Rietveld 408576698