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

Issue 115334: Use the Mac omnibox field's font as the basis for the fonts used in the field and popup. (Closed)

Created:
11 years, 7 months ago by Scott Hess - ex-Googler
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Use the Mac omnibox field's font as the basis for the fonts used in the field and popup. NSAttributedString has fixed default font, unless overridden, this basically makes the font used consistent with the field size. Theming will most likely change this again, but we can be prettier in the meanwhile.

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address Pink's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -51 lines) Patch
M chrome/browser/autocomplete/autocomplete_edit_view_mac.mm View 1 chunk +6 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_mac.h View 1 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_mac.mm View 1 7 chunks +40 lines, -31 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_mac_unittest.mm View 1 15 chunks +26 lines, -16 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Scott Hess - ex-Googler
I got annoyed by the randomness of the fonts for autocomplete. This makes them consistent. ...
11 years, 7 months ago (2009-05-14 00:30:14 UTC) #1
pink (ping after 24hrs)
LGTM with issues addressed. http://codereview.chromium.org/115334/diff/1/3 File chrome/browser/autocomplete/autocomplete_popup_view_mac.h (right): http://codereview.chromium.org/115334/diff/1/3#newcode76 Line 76: static NSMutableAttributedString* MatchText(const AutocompleteMatch& ...
11 years, 7 months ago (2009-05-14 16:11:24 UTC) #2
Scott Hess - ex-Googler
Addressed all but fully converting DecorateMatchedString() to non-mutable. http://codereview.chromium.org/115334/diff/1/3 File chrome/browser/autocomplete/autocomplete_popup_view_mac.h (right): http://codereview.chromium.org/115334/diff/1/3#newcode76 Line 76: ...
11 years, 7 months ago (2009-05-14 18:40:44 UTC) #3
pink (ping after 24hrs)
http://codereview.chromium.org/115334/diff/1/3 File chrome/browser/autocomplete/autocomplete_popup_view_mac.h (right): http://codereview.chromium.org/115334/diff/1/3#newcode76 Line 76: static NSMutableAttributedString* MatchText(const AutocompleteMatch& match, On 2009/05/14 18:40:44, ...
11 years, 7 months ago (2009-05-14 19:09:01 UTC) #4
Scott Hess - ex-Googler
11 years, 7 months ago (2009-05-14 21:54:55 UTC) #5
Thanks.

http://codereview.chromium.org/115334/diff/1/3
File chrome/browser/autocomplete/autocomplete_popup_view_mac.h (right):

http://codereview.chromium.org/115334/diff/1/3#newcode76
Line 76: static NSMutableAttributedString* MatchText(const AutocompleteMatch&
match,
On 2009/05/14 19:09:01, pink wrote:
> On 2009/05/14 18:40:44, shess wrote:
> > On 2009/05/14 16:11:24, pink wrote:
> > > this should just return a NSAttributedString. The callers don't care that
> it's
> > > mutable.
> > 
> > MatchText() callers certainly don't care.  I made DecorateMatchedString()
> return
> > mutable because MatchText() needs to append things together, and set the
> > line-break style for the overall string.  The button cell's line-break mode
> > doesn't apply in this case, it has to be in the attributed string.
> > 
> > I can go non-mutable and spin off additional objects.  Or I could pass base
> > attributes into DecorateMatchedString(), which wouldn't be too bad.  I'll go
> > poke at the code to see what looks pretty and post again, let me know if you
> > have a particular preference.
> 
> No preference. You can probably leave it as Mutable if that makes things
easier.

I couldn't see a good approach which didn't either result in the caller having
to make mutable copies for purposes of making a couple more manipulations, or
modifying the decorator to accept extraneous stuff so that the attributed
strings come out right from the get-go.  There's probably a deep discussion on
the order of string versus stringbuffer lurking in here, but I'm inclined to
just leave it mutable, since it only exists as a helper for MatchText().

Powered by Google App Engine
This is Rietveld 408576698