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

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

Issue 384105: Mac: Animate the bookmark bar showing/hiding. (Closed)
Patch Set: Comments added per rohitrao's review. Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.h ('k') | chrome/browser/cocoa/toolbar_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/toolbar_controller.mm
diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm
index 9092b5158f4c41e31b581d294f622fe6c8248412..8653f4969df43ffe936d8e33cc95cb01050003b5 100644
--- a/chrome/browser/cocoa/toolbar_controller.mm
+++ b/chrome/browser/cocoa/toolbar_controller.mm
@@ -15,6 +15,7 @@
#import "chrome/browser/cocoa/autocomplete_text_field.h"
#import "chrome/browser/cocoa/autocomplete_text_field_editor.h"
#import "chrome/browser/cocoa/back_forward_menu_controller.h"
+#import "chrome/browser/cocoa/background_gradient_view.h"
#import "chrome/browser/cocoa/encoding_menu_controller_delegate_mac.h"
#import "chrome/browser/cocoa/extensions/browser_actions_controller.h"
#import "chrome/browser/cocoa/gradient_button_cell.h"
@@ -45,12 +46,10 @@ static NSString* const kWrenchButtonImageName = @"menu_chrome_Template.pdf";
// Height of the toolbar in pixels when the bookmark bar is closed.
static const float kBaseToolbarHeight = 36.0;
-// Overlap (in pixels) between the toolbar and the bookmark bar.
-static const float kBookmarkBarOverlap = 6.0;
-
@interface ToolbarController(Private)
- (void)initCommandStatus:(CommandUpdater*)commands;
- (void)prefChanged:(std::wstring*)prefName;
+- (BackgroundGradientView*)backgroundGradientView;
- (void)browserActionsChanged;
- (void)adjustLocationAndGoPositionsBy:(CGFloat)dX;
@end
@@ -352,7 +351,10 @@ class PrefObserverBridge : public NotificationObserver {
return locationBar_;
}
+// (Private) Returns the backdrop to the toolbar.
- (BackgroundGradientView*)backgroundGradientView {
+ // We really do mean |[super view]|; see our override of |-view|.
+ DCHECK([[super view] isKindOfClass:[BackgroundGradientView class]]);
return (BackgroundGradientView*)[super view];
}
@@ -514,14 +516,16 @@ class PrefObserverBridge : public NotificationObserver {
fromView:starButton_];
}
-- (void)setShouldBeCompressed:(BOOL)compressed {
- CGFloat newToolbarHeight = kBaseToolbarHeight;
- if (compressed)
- newToolbarHeight -= kBookmarkBarOverlap;
-
+- (void)setHeightCompression:(CGFloat)compressByHeight {
+ // Resize.
+ CGFloat newToolbarHeight = kBaseToolbarHeight - compressByHeight;
[resizeDelegate_ resizeView:[self view] newHeight:newToolbarHeight];
}
+- (void)setShowsDivider:(BOOL)showDivider {
+ [[self backgroundGradientView] setShowsDivider:showDivider];
+}
+
- (NSString*)view:(NSView*)view
stringForToolTip:(NSToolTipTag)tag
point:(NSPoint)point
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.h ('k') | chrome/browser/cocoa/toolbar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698