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

Unified Diff: chrome/browser/cocoa/bookmark_bar_controller.mm

Issue 155494: First cut at infobars on Mac. These are not expected to be... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 5 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/cocoa/bookmark_bar_controller.mm
===================================================================
--- chrome/browser/cocoa/bookmark_bar_controller.mm (revision 20925)
+++ chrome/browser/cocoa/bookmark_bar_controller.mm (working copy)
@@ -44,6 +44,7 @@
- (id)initWithProfile:(Profile*)profile
parentView:(NSView*)parentView
webContentView:(NSView*)webContentView
+ infoBarsView:(NSView*)infoBarsView
delegate:(id<BookmarkURLOpener>)delegate {
if ((self = [super initWithNibName:@"BookmarkBar"
bundle:mac_util::MainAppBundle()])) {
@@ -51,6 +52,7 @@
preferences_ = profile->GetPrefs();
parentView_ = parentView;
webContentView_ = webContentView;
+ infoBarsView_ = infoBarsView;
delegate_ = delegate;
}
return self;
@@ -120,6 +122,7 @@
NSRect superframe = [parentView_ frame];
NSRect frame = [[self view] frame];
NSRect webframe = [webContentView_ frame];
+ NSRect infoframe = [infoBarsView_ frame];
if (apply) {
superframe.size.height += kBookmarkBarSuperviewHeightAdjustment;
// TODO(jrg): y=0 if we add the bookmark bar before the parent
@@ -131,11 +134,13 @@
webframe.size.height -= kBookmarkBarWebframeHeightAdjustment;
}
frame.size.height += kBookmarkBarHeight;
+ infoframe.origin.y -= kBookmarkBarWebframeHeightAdjustment;
} else {
superframe.size.height -= kBookmarkBarSuperviewHeightAdjustment;
superframe.origin.y += kBookmarkBarSuperviewHeightAdjustment;
frame.size.height -= kBookmarkBarHeight;
webframe.size.height += kBookmarkBarWebframeHeightAdjustment;
+ infoframe.origin.y += kBookmarkBarWebframeHeightAdjustment;
}
// TODO(jrg): Animators can be a little fussy. Setting these three
@@ -145,16 +150,19 @@
if (1 /* immediately */) {
[parentView_ setFrame:superframe];
[webContentView_ setFrame:webframe];
+ [infoBarsView_ setFrame:infoframe];
[[self view] setFrame:frame];
} else {
[[parentView_ animator] setFrame:superframe];
[[webContentView_ animator] setFrame:webframe];
+ [[infoBarsView_ animator] setFrame:infoframe];
[[[self view] animator] setFrame:frame];
}
[[self view] setNeedsDisplay:YES];
[parentView_ setNeedsDisplay:YES];
[webContentView_ setNeedsDisplay:YES];
+ [infoBarsView_ setNeedsDisplay:YES];
}
- (BOOL)isBookmarkBarVisible {
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_controller.h ('k') | chrome/browser/cocoa/bookmark_bar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698