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

Issue 2971004: [Mac] Star as a rhs-decoration in AutocompleteTextFieldCell. (Closed)

Created:
10 years, 5 months ago by Scott Hess - ex-Googler
Modified:
9 years, 6 months ago
CC:
chromium-reviews, John Grabowski, pam+watch_chromium.org, ben+cc_chromium.org, Paweł Hajdan Jr.
Base URL:
git://codf21.jail/chromium.git
Visibility:
Public.

Description

[Mac] Star as a rhs-decoration in AutocompleteTextFieldCell. Refactor to convert star decoration to LocationBarDecoration. BUG=none TEST=Star icon continues to work. TEST=Bookmark bubble pops in the right place. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=52422

Patch Set 1 #

Total comments: 8

Patch Set 2 : Changes for rohit, unit-test tweaks. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+382 lines, -178 lines) Patch
M chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h View 3 chunks +8 lines, -12 lines 0 comments Download
M chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm View 1 15 chunks +100 lines, -58 lines 0 comments Download
M chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm View 4 chunks +20 lines, -1 line 0 comments Download
A chrome/browser/cocoa/location_bar/image_decoration.h View 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/browser/cocoa/location_bar/image_decoration.mm View 1 chunk +51 lines, -0 lines 0 comments Download
A chrome/browser/cocoa/location_bar/image_decoration_unittest.mm View 1 chunk +55 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/location_bar/location_bar_view_mac.h View 3 chunks +2 lines, -25 lines 0 comments Download
M chrome/browser/cocoa/location_bar/location_bar_view_mac.mm View 9 chunks +10 lines, -39 lines 0 comments Download
M chrome/browser/cocoa/location_bar/location_icon_decoration.h View 2 chunks +2 lines, -13 lines 0 comments Download
M chrome/browser/cocoa/location_bar/location_icon_decoration.mm View 2 chunks +0 lines, -30 lines 0 comments Download
A chrome/browser/cocoa/location_bar/star_decoration.h View 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/cocoa/location_bar/star_decoration.mm View 1 1 chunk +52 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Scott Hess - ex-Googler
10 years, 5 months ago (2010-07-13 23:29:06 UTC) #1
rohitrao (ping after 24h)
LGTM What's the plan for multiple RHS decorations, with crazy ordering rules? Page action icons ...
10 years, 5 months ago (2010-07-14 17:02:57 UTC) #2
Scott Hess - ex-Googler
10 years, 5 months ago (2010-07-14 20:19:20 UTC) #3
On 2010/07/14 17:02:57, rohitrao wrote:
> LGTM

Applied your suggestions, and merged in the globe fix (I had fixed it alrady as
part of breaking out ImageDecoration, the shame).  That one will go in first.

> What's the plan for multiple RHS decorations, with crazy ordering rules?  Page
> action icons go on the left, in the order they were added, but the star is
> always on the right, unless the moon is aligned incorrectly.  Do we just put
all
> that crazy logic into Layout()?

Layout() will have all that crazy logic.  I believe that everything is ordered
the same way at all times, but visibility changes depending on mode.  So
everything will be present in the list, but sometimes visible, sometimes not. 
There's also a level of size-to-fit involved which I suspect will lead to some
tweaks.  I believe all of this can (reasonably) be labelled "bugs" rather than
"features", though, so long as all of of the infrastructure is in there baking.

http://codereview.chromium.org/2971004/diff/1/3
File chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm (right):

http://codereview.chromium.org/2971004/diff/1/3#newcode112
chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm:112: const
NSRect cell_frame,
On 2010/07/14 17:02:57, rohitrao wrote:
> Is Trung going to yell about constness here?

I'll un-const them.

http://codereview.chromium.org/2971004/diff/1/3#newcode188
chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm:188:
DCHECK_EQ(decorations->size(), decoration_frames->size());
On 2010/07/14 17:02:57, rohitrao wrote:
> Does it make sense to move this check into the helper function?  (Also below.)

I will add another check to the helper function.  Hard to see a downside to
excessive checks on this.

Could replace the parallel vectors with a vector of pairs.  WDYT?  I'm kind of
mixed on the notion, since everything will get a bit more verbose (the overall
statement being made will be the same, but using fewer longer sentences instead
of more shorter sentences).

http://codereview.chromium.org/2971004/diff/1/4
File chrome/browser/cocoa/location_bar/image_decoration.h (right):

http://codereview.chromium.org/2971004/diff/1/4#newcode23
chrome/browser/cocoa/location_bar/image_decoration.h:23: NSRect
GetDrawRectInFrame(NSRect frame);
On 2010/07/14 17:02:57, rohitrao wrote:
> I got confused by a method name that started with two verbs :)

Hmm.  DrawRect being a noun, here, but I can see what you mean.  I didn't like
the Rect and Frame both in there, but DrawFrame seemed even worse.

GetImageRectInFrame(), maybe?

http://codereview.chromium.org/2971004/diff/1/11
File chrome/browser/cocoa/location_bar/star_decoration.mm (right):

http://codereview.chromium.org/2971004/diff/1/11#newcode35
chrome/browser/cocoa/location_bar/star_decoration.mm:35: return
NSMakePoint(NSMidX(draw_frame), NSMaxY(draw_frame) - 4.0);
On 2010/07/14 17:02:57, rohitrao wrote:
> Where did 4.0 come from?  Can it be a constant?

Came from the earlier code, which came from inspection.  Will move to a
constant.

Powered by Google App Engine
This is Rietveld 408576698