Commit 85027589 authored by erikchen@chromium.org's avatar erikchen@chromium.org

mac: Add a missing animation context to bookmark bar controller.

The animation was not specifying an NSAnimationContext or duration, which meant
that the duration was not well defined. I used the same value that I observed
on my machine prior to my change. It seems a bit slow, but presumably it's the
value most users are seeing.

BUG=NONE
TEST=NONE

Review URL: https://codereview.chromium.org/110753004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243383 0039d316-1c4b-4281-b951-d872f2087c98
parent f971f9ca
......@@ -129,6 +129,7 @@ namespace {
// Duration of the bookmark bar animations.
const NSTimeInterval kBookmarkBarAnimationDuration = 0.12;
const NSTimeInterval kDragAndDropAnimationDuration = 0.25;
void RecordAppLaunch(Profile* profile, GURL url) {
DCHECK(profile->GetExtensionService());
......@@ -1939,6 +1940,9 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
}
// Put all the buttons where they belong, with all buttons to the right
// of the insertion point shuffling right to make space for it.
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext]
setDuration:kDragAndDropAnimationDuration];
for (NSButton* button in buttons_.get()) {
// Hidden buttons get no space.
if ([button isHidden])
......@@ -1955,6 +1959,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
else
[button setFrame:buttonFrame];
}
[NSAnimationContext endGrouping];
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment