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

Issue 384105: Mac: Animate the bookmark bar showing/hiding. (Closed)

Created:
11 years, 1 month ago by viettrungluu
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Mac: Animate the bookmark bar showing/hiding. There's a huge refactoring of the bookmark bar controller in this CL, so that animation-related code is in only a few places (instead of scattered all over the place). Changes to BookmarkBar.xib: Since BookmarkBarToolbarView now inherits from AnimatableView, I had to hook up its delegate_ member to File's Owner (i.e., the BookmarkBarController). Not yet implemented: morphing between the detached bar (on the NTP) and anything else. BUG=25600 TEST=Go to a normal page, show/hide the bookmark bar (Shift-Cmd-B), watch it animate. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31977

Patch Set 1 #

Total comments: 19

Patch Set 2 : Merge ToT and updated chrome.gyp. #

Total comments: 27

Patch Set 3 : Fixed per reviews. #

Patch Set 4 : Added a big comment. #

Patch Set 5 : Fix possible badness on close (and badness in unit test). #

Total comments: 9

Patch Set 6 : Comments added per rohitrao's review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+869 lines, -307 lines) Patch
M chrome/app/nibs/BookmarkBar.xib View 20 chunks +238 lines, -13 lines 0 comments Download
M chrome/browser/browser.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/animatable_view.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller.h View 1 2 3 4 5 6 chunks +75 lines, -33 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller.mm View 1 2 3 4 5 12 chunks +332 lines, -64 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller_unittest.mm View 1 2 13 chunks +57 lines, -73 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_toolbar_view.h View 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_toolbar_view.mm View 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_toolbar_view_unittest.mm View 6 chunks +14 lines, -15 lines 0 comments Download
M chrome/browser/cocoa/browser_window_cocoa.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/cocoa/browser_window_controller.h View 1 2 3 4 5 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller.mm View 1 2 3 4 5 14 chunks +103 lines, -47 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller_unittest.mm View 1 2 2 chunks +2 lines, -1 line 0 comments Download
D chrome/browser/cocoa/toolbar_compressable.h View 1 chunk +0 lines, -19 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.h View 1 5 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.mm View 1 2 4 chunks +12 lines, -8 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller_unittest.mm View 1 1 chunk +5 lines, -8 lines 0 comments Download
M chrome/browser/cocoa/view_resizer_pong.mm View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/chrome.gyp View 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
viettrungluu
This animates only the normal bookmark bar, and not yet the NTP detached bar. I ...
11 years, 1 month ago (2009-11-13 01:06:00 UTC) #1
rohitrao (ping after 24h)
Quick comments while I keep looking at this more. My one high level comment is ...
11 years, 1 month ago (2009-11-13 02:45:19 UTC) #2
TVL
drive by http://codereview.chromium.org/384105/diff/3001/4006 File chrome/browser/cocoa/bookmark_bar_controller.mm (right): http://codereview.chromium.org/384105/diff/3001/4006#newcode44 Line 44: static const NSTimeInterval kBookmarkBarAnimationDuration = 0.2; ...
11 years, 1 month ago (2009-11-13 03:56:53 UTC) #3
John Grabowski
I second Rohit's comments that a big high level comment is in order. There's a ...
11 years, 1 month ago (2009-11-13 05:34:08 UTC) #4
rohitrao (ping after 24h)
A few more comments. I'm starting to understand how all of this is supposed to ...
11 years, 1 month ago (2009-11-13 17:05:51 UTC) #5
viettrungluu
Thanks everyone for the reviews. I *think* I've done (or at least responded to) everything. ...
11 years, 1 month ago (2009-11-13 20:34:46 UTC) #6
viettrungluu
Okay, new, big comment added. Now to investigate a problem with BrowserWindowCocoaTest....
11 years, 1 month ago (2009-11-13 21:06:45 UTC) #7
John Grabowski
LGTM from me but please wait for others to confirm.
11 years, 1 month ago (2009-11-13 21:48:53 UTC) #8
rohitrao (ping after 24h)
LGTM Please make another pass with the testing of edge cases :) I'm mostly worried ...
11 years, 1 month ago (2009-11-14 00:05:43 UTC) #9
viettrungluu
11 years, 1 month ago (2009-11-14 00:59:26 UTC) #10
I took another pass at getting it to crash and I failed (to crash it). We're
actually pretty zealous about cancelling animations though. (Overzealous,
leading to some incorrect cancellations, though this is really only noticeable
because I've turned up the animation durations; possibly this occurs on Windows
too.... I'll file a bug against myself.)

http://codereview.chromium.org/384105/diff/3028/8025
File chrome/browser/cocoa/bookmark_bar_controller.h (right):

http://codereview.chromium.org/384105/diff/3028/8025#newcode56
Line 56: // display update.
On 2009/11/14 00:05:44, rohitrao wrote:
> Should we detail exactly what the delegate is supposed to do in these methods
> (compress the toolbar, remove the divider, etc).
> 
> Maybe it's breaking the abstraction a little bit, but I think the concepts of
> "BWC" and "toolbar" are already referenced in so many places that it wouldn't
be
> too bad.  Having a concise description somewhere of what these methods should
do
> would be helpful.

Done.

http://codereview.chromium.org/384105/diff/3028/8026
File chrome/browser/cocoa/bookmark_bar_controller.mm (right):

http://codereview.chromium.org/384105/diff/3028/8026#newcode415
Line 415: if ((lastVisualState_ == bookmarks::kHiddenState &&
On 2009/11/14 00:05:44, rohitrao wrote:
> Can you add a line explaining what these two cases are?  (Animating open and
> animating closed, I think.)

Done.

http://codereview.chromium.org/384105/diff/3028/8026#newcode430
Line 430: if ((lastVisualState_ == bookmarks::kHiddenState &&
On 2009/11/14 00:05:44, rohitrao wrote:
> Animating open and animating closed?

Yes. Comment added (also explaining the "< 1" part below).

http://codereview.chromium.org/384105/diff/3028/8033
File chrome/browser/cocoa/browser_window_controller.mm (right):

http://codereview.chromium.org/384105/diff/3028/8033#newcode1332
Line 1332: //    the sheet below the bookmark bar.
On 2009/11/14 00:05:44, rohitrao wrote:
> //  - If the bar is currently animating, position the sheet according to where
> the bar will be when the animation ends.

Done.

Powered by Google App Engine
This is Rietveld 408576698