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

Issue 155358: More bookmark bar changes.... (Closed)

Created:
11 years, 5 months ago by John Grabowski
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, John Grabowski, Ben Goodger (Google), rohitrao (ping after 24h)
Visibility:
Public.

Description

More bookmark bar changes. * Applied memory cleanliness fix in unit test; follow-up from http://codereview.chromium.org/149308. * Move bookmark bar into it's own nib; minor code refactor to accomodate. * The toolbar STAR button somehow lost it's action; added it back in. * Implemented delete bookmark notification callback so we behave (remove button from the screen) when a bookmark is deleted. * Added context menus for the bookmark bar and bookmark buttons. * Hooked up a handful of these menu items. E.g. - open in new tab, window, incog window - delete bookmark (finally) - bookmark manager (which then hits a NOTIMPLEMENTED()) - always show bookmark bar * Truncate bookmark button text on end, not on middle. Experimental to look more like Windows. It looks cleaner but is less Mac-like. * Add "draws border when mouse goes over" for bookmark buttons. Need to do it by hand since we have a custom button drawing method. BUG=crbug.com/8381 TEST=Here's a list: - Make sure the bookmark buttons don't have a border unless the mouse is over them - Toolbar "STAR" should now add bookmarks when clicked - Test context menus on bookmark buttons, and the bar itself - Confirm a few of the behaviors as listed in the 'what I hooked up'; e.g. Right click on bookmark --> delete menu item should delete button Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20591

Patch Set 1 #

Total comments: 10

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1285 lines, -142 lines) Patch
A chrome/app/nibs/en.lproj/BookmarkBar.xib View 1 chunk +854 lines, -0 lines 0 comments Download
M chrome/app/nibs/en.lproj/Toolbar.xib View 1 2 3 10 chunks +6 lines, -31 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_bridge.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_bridge.mm View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm View 1 2 3 4 chunks +23 lines, -11 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller.h View 1 2 3 6 chunks +18 lines, -14 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller.mm View 1 2 3 15 chunks +96 lines, -55 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller_unittest.mm View 1 2 3 6 chunks +57 lines, -15 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_view.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_view.mm View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_view_unittest.mm View 1 2 3 1 chunk +54 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/bookmark_button_cell.mm View 1 2 3 2 chunks +26 lines, -1 line 0 comments Download
M chrome/browser/cocoa/bookmark_button_cell_unittest.mm View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/gradient_button_cell.h View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/gradient_button_cell.mm View 1 2 3 3 chunks +55 lines, -3 lines 0 comments Download
M chrome/browser/cocoa/gradient_button_cell_unittest.mm View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/tab_window_controller.mm View 2 chunks +1 line, -5 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.h View 1 2 3 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.mm View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller_unittest.mm View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
John Grabowski
11 years, 5 months ago (2009-07-10 18:26:44 UTC) #1
John Grabowski
11 years, 5 months ago (2009-07-10 18:27:32 UTC) #2
pink (ping after 24hrs)
LGTM with these small things. http://codereview.chromium.org/155358/diff/1/18 File chrome/browser/cocoa/bookmark_bar_controller_unittest.mm (right): http://codereview.chromium.org/155358/diff/1/18#newcode105 Line 105: scoped_nsobject<NSMenu> menu([[NSMenu alloc] ...
11 years, 5 months ago (2009-07-13 16:20:37 UTC) #3
John Grabowski
11 years, 5 months ago (2009-07-13 21:38:09 UTC) #4
http://codereview.chromium.org/155358/diff/1/18
File chrome/browser/cocoa/bookmark_bar_controller_unittest.mm (right):

http://codereview.chromium.org/155358/diff/1/18#newcode105
Line 105: scoped_nsobject<NSMenu> menu([[NSMenu alloc]
initWithTitle:@"I_dont_care"]);
On 2009/07/13 16:20:37, pink wrote:
> is this menu needed to test calling the selectors below?

Yes.  I'm reusing the context menu for all buttons.  The way I disambiguate is
by setting the menu's delegate to be the button's cell when the cell is asked
for it's menu.  The button's cell contains the BookmarkNode as it's
representedObject.

http://codereview.chromium.org/155358/diff/1/4
File chrome/browser/cocoa/bookmark_bar_view.mm (right):

http://codereview.chromium.org/155358/diff/1/4#newcode10
Line 10: - (void)setContextMenu:(NSMenu*)menu {
On 2009/07/13 16:20:37, pink wrote:
> What about using "+ (NSMenu *)defaultMenu"?

In the normal case this menu is hooked up by the nib load.
When this API is called, we are slamming in a mock.
If I overrode "+defaultMenu", I'd still need a "set default menu" call.

http://codereview.chromium.org/155358/diff/1/13
File chrome/browser/cocoa/bookmark_bar_view_unittest.mm (right):

http://codereview.chromium.org/155358/diff/1/13#newcode12
Line 12: 
On 2009/07/13 16:20:37, pink wrote:
> omit blank line

killed

http://codereview.chromium.org/155358/diff/1/8
File chrome/browser/cocoa/bookmark_button_cell.mm (right):

http://codereview.chromium.org/155358/diff/1/8#newcode13
Line 13: [self setBezelStyle:NSShadowlessSquareBezelStyle];
On 2009/07/13 16:20:37, pink wrote:
> you call setBezelStyle here twice with different values.

Doh!  Fixed.

http://codereview.chromium.org/155358/diff/1/8#newcode29
Line 29: : GTMThemeStyleBookmarksBar;
On 2009/07/13 16:20:37, pink wrote:
> continuation indented at least 4 spaces.

Fixed

Powered by Google App Engine
This is Rietveld 408576698