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

Issue 9696057: Prioritize smaller favicons over larger ones for tabs, etc. (Closed)

Created:
8 years, 9 months ago by stevenjb
Modified:
8 years, 9 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Prioritize smaller favicons over larger ones for tabs, etc. Currently if multiple favicons are specified (through <link rel="icon"> tags), the first favicon specified will be used. Unfortunately, this ordering is inconsistent, at least when using querySelector. In order to support multiply sized icons for the Ash Launcher, we need to prioritize properly sized favicons (i.e. closest to 16x16) for normal favicons (type FaviconURL::FAVICON). BUG=110143 TEST=Test favicon behavior thoroughly. On Ash with the latest GTalk, avatar icons should show in the launcher and status icons should show in the title bar. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=127737

Patch Set 1 #

Patch Set 2 : Appease clang #

Total comments: 6

Patch Set 3 : Add unit test for multiple favicons. #

Patch Set 4 : Comment change. #

Total comments: 4

Patch Set 5 : Cache bitmap in FaviconCandidate. #

Patch Set 6 : Store single FavionCandidate #

Total comments: 10

Patch Set 7 : Clear download requests if Fetch is called while processing candidates. #

Patch Set 8 : Split OnUpdateFaviconURL into two parts #

Total comments: 8

Patch Set 9 : Address comments. #

Patch Set 10 : Don't clear download_requests_ #

Patch Set 11 : Rebase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+287 lines, -128 lines) Patch
M chrome/browser/favicon/favicon_handler.h View 1 2 3 4 5 6 7 8 8 chunks +44 lines, -19 lines 0 comments Download
M chrome/browser/favicon/favicon_handler.cc View 1 2 3 4 5 6 7 8 9 8 chunks +96 lines, -25 lines 2 comments Download
M chrome/browser/favicon/favicon_handler_unittest.cc View 1 2 3 4 5 6 7 24 chunks +147 lines, -84 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
stevenjb
8 years, 9 months ago (2012-03-13 22:40:32 UTC) #1
michaelbai
It seems that you didn't fix the root cause. Note that, we only support 3 ...
8 years, 9 months ago (2012-03-13 23:38:11 UTC) #2
sky
This looks good, but could you add some test coverage? http://codereview.chromium.org/9696057/diff/3001/chrome/browser/favicon/favicon_handler.h File chrome/browser/favicon/favicon_handler.h (right): http://codereview.chromium.org/9696057/diff/3001/chrome/browser/favicon/favicon_handler.h#newcode173 ...
8 years, 9 months ago (2012-03-13 23:46:06 UTC) #3
stevenjb
Ah, I think there is some confusion here. It is perfectly valid for a website ...
8 years, 9 months ago (2012-03-13 23:50:11 UTC) #4
michaelbai
On 2012/03/13 23:50:11, stevenjb (chromium) wrote: > Ah, I think there is some confusion here. ...
8 years, 9 months ago (2012-03-14 04:52:00 UTC) #5
michaelbai
http://codereview.chromium.org/9696057/diff/3001/chrome/browser/favicon/favicon_handler.h File chrome/browser/favicon/favicon_handler.h (right): http://codereview.chromium.org/9696057/diff/3001/chrome/browser/favicon/favicon_handler.h#newcode229 chrome/browser/favicon/favicon_handler.h:229: // that either the width and/or height is 16 ...
8 years, 9 months ago (2012-03-14 05:01:03 UTC) #6
stevenjb
Test added. PTAL. http://codereview.chromium.org/9696057/diff/3001/chrome/browser/favicon/favicon_handler.h File chrome/browser/favicon/favicon_handler.h (right): http://codereview.chromium.org/9696057/diff/3001/chrome/browser/favicon/favicon_handler.h#newcode173 chrome/browser/favicon/favicon_handler.h:173: FaviconCandidate() {} On 2012/03/13 23:46:06, sky ...
8 years, 9 months ago (2012-03-14 21:35:26 UTC) #7
michaelbai
On 2012/03/14 21:35:26, stevenjb (chromium) wrote: > Test added. PTAL. > > http://codereview.chromium.org/9696057/diff/3001/chrome/browser/favicon/favicon_handler.h > File ...
8 years, 9 months ago (2012-03-14 21:41:38 UTC) #8
stevenjb
On 2012/03/14 21:41:38, michaelbai wrote: > On 2012/03/14 21:35:26, stevenjb (chromium) wrote: > > Test ...
8 years, 9 months ago (2012-03-14 22:11:19 UTC) #9
michaelbai
Thanks for the information http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc#newcode297 chrome/browser/favicon/favicon_handler.cc:297: i->second.url, image_url, image, i->second.icon_type)); Would ...
8 years, 9 months ago (2012-03-14 22:34:14 UTC) #10
Peter Kasting
We already have code in the WebKit glue layer that tries to pick the right ...
8 years, 9 months ago (2012-03-14 22:37:28 UTC) #11
stevenjb
http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc#newcode297 chrome/browser/favicon/favicon_handler.cc:297: i->second.url, image_url, image, i->second.icon_type)); On 2012/03/14 22:34:14, michaelbai wrote: ...
8 years, 9 months ago (2012-03-15 00:45:53 UTC) #12
stevenjb
On 2012/03/14 22:37:28, Peter Kasting wrote: > We already have code in the WebKit glue ...
8 years, 9 months ago (2012-03-15 00:55:34 UTC) #13
michaelbai
http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc#newcode297 chrome/browser/favicon/favicon_handler.cc:297: i->second.url, image_url, image, i->second.icon_type)); It seemed you don't need ...
8 years, 9 months ago (2012-03-15 01:12:00 UTC) #14
stevenjb
PTAL http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/8003/chrome/browser/favicon/favicon_handler.cc#newcode297 chrome/browser/favicon/favicon_handler.cc:297: i->second.url, image_url, image, i->second.icon_type)); On 2012/03/15 01:12:00, michaelbai ...
8 years, 9 months ago (2012-03-15 21:05:09 UTC) #15
michaelbai
Thought about your change carefully, I am afraid there is race condition, please check my ...
8 years, 9 months ago (2012-03-15 22:39:53 UTC) #16
stevenjb
http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc#newcode130 chrome/browser/favicon/favicon_handler.cc:130: favicon_candidate_.icon_type = history::INVALID_ICON; On 2012/03/15 22:39:53, michaelbai wrote: > ...
8 years, 9 months ago (2012-03-15 23:29:05 UTC) #17
stevenjb
ping
8 years, 9 months ago (2012-03-16 21:19:34 UTC) #18
sky
http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc#newcode130 chrome/browser/favicon/favicon_handler.cc:130: favicon_candidate_.icon_type = history::INVALID_ICON; On 2012/03/15 23:29:06, stevenjb (chromium) wrote: ...
8 years, 9 months ago (2012-03-16 22:15:09 UTC) #19
stevenjb
http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc#newcode130 chrome/browser/favicon/favicon_handler.cc:130: favicon_candidate_.icon_type = history::INVALID_ICON; On 2012/03/16 22:15:09, sky wrote: > ...
8 years, 9 months ago (2012-03-16 22:31:29 UTC) #20
stevenjb
OK, I think this makes things a little cleaner/safer since we now have a separate ...
8 years, 9 months ago (2012-03-16 23:16:24 UTC) #21
sky
On 2012/03/16 22:31:29, stevenjb (chromium) wrote: > http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc > File chrome/browser/favicon/favicon_handler.cc (right): > > http://codereview.chromium.org/9696057/diff/7012/chrome/browser/favicon/favicon_handler.cc#newcode130 ...
8 years, 9 months ago (2012-03-16 23:16:31 UTC) #22
sky
LGTM http://codereview.chromium.org/9696057/diff/17002/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/17002/chrome/browser/favicon/favicon_handler.cc#newcode127 chrome/browser/favicon/favicon_handler.cc:127: favicon_candidate_.icon_type = history::INVALID_ICON; For safety reset favicon_candidate_ entirely ...
8 years, 9 months ago (2012-03-16 23:29:15 UTC) #23
stevenjb
http://codereview.chromium.org/9696057/diff/17002/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/17002/chrome/browser/favicon/favicon_handler.cc#newcode127 chrome/browser/favicon/favicon_handler.cc:127: favicon_candidate_.icon_type = history::INVALID_ICON; On 2012/03/16 23:29:15, sky wrote: > ...
8 years, 9 months ago (2012-03-17 00:23:07 UTC) #24
stevenjb
PTAL I looked more closely at download_requests_ and I see now how clearing it could ...
8 years, 9 months ago (2012-03-19 16:47:30 UTC) #25
michaelbai
The previous code could save the icon to history backend even the image_urls was change. ...
8 years, 9 months ago (2012-03-19 18:27:10 UTC) #26
stevenjb
On 2012/03/19 18:27:10, michaelbai wrote: > The previous code could save the icon to history ...
8 years, 9 months ago (2012-03-19 19:12:46 UTC) #27
sky
http://codereview.chromium.org/9696057/diff/22005/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/22005/chrome/browser/favicon/favicon_handler.cc#newcode231 chrome/browser/favicon/favicon_handler.cc:231: void FaviconHandler::OnUpdateFaviconURL( I'm pretty sure that the page can ...
8 years, 9 months ago (2012-03-19 20:34:56 UTC) #28
stevenjb
http://codereview.chromium.org/9696057/diff/22005/chrome/browser/favicon/favicon_handler.cc File chrome/browser/favicon/favicon_handler.cc (right): http://codereview.chromium.org/9696057/diff/22005/chrome/browser/favicon/favicon_handler.cc#newcode231 chrome/browser/favicon/favicon_handler.cc:231: void FaviconHandler::OnUpdateFaviconURL( On 2012/03/19 20:34:56, sky wrote: > I'm ...
8 years, 9 months ago (2012-03-19 20:48:26 UTC) #29
sky
SLGTM
8 years, 9 months ago (2012-03-19 20:56:04 UTC) #30
michaelbai
LGTM I saw your point, I have no issue with your change. Thanks for your ...
8 years, 9 months ago (2012-03-20 01:10:37 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/stevenjb@chromium.org/9696057/22005
8 years, 9 months ago (2012-03-20 17:28:58 UTC) #32
stevenjb
On 2012/03/20 01:10:37, michaelbai wrote: > LGTM > > I saw your point, I have ...
8 years, 9 months ago (2012-03-20 17:29:35 UTC) #33
commit-bot: I haz the power
Change committed as 127737
8 years, 9 months ago (2012-03-20 18:48:44 UTC) #34
Peter Kasting
On 2012/03/15 00:55:34, stevenjb (chromium) wrote: > On 2012/03/14 22:37:28, Peter Kasting wrote: > > ...
8 years, 9 months ago (2012-03-20 19:16:18 UTC) #35
stevenjb (google-dont-use)
8 years, 9 months ago (2012-03-20 20:13:36 UTC) #36
Ah, thanks for the pointer, it's good to be aware of. The code is
definitely similar, but different enough that we couldn't have used it
directly.

Thanks!
-Steven

On Tue, Mar 20, 2012 at 12:16 PM, <pkasting@chromium.org> wrote:

> On 2012/03/15 00:55:34, stevenjb (chromium) wrote:
>
>> On 2012/03/14 22:37:28, Peter Kasting wrote:
>> > We already have code in the WebKit glue layer that tries to pick the
>> right
>> size
>> > image for a favicon (when provided with e.g. an ICO file that has
>> multiple
>> > subimages).  Are you familiar with it?  Can we implement what you want
>> in
>> terms
>> > of that code?  I would prefer to avoid code duplication if possible.
>>
>
>  I'm not familiar with that code, can you point me to it?
>> I suspect that it will be orthogonal to this - it sounds like that code
>> correctly chooses the size of multi-resolution images, where as this is
>>
> designed
>
>> to choose the best sized icon when more than one <link rel="icon"> is
>>
> provided.
>
>> Assuming that the WebKit glue code also matches gfx::kFaviconSize, a
>> multi-resolution image should result in a matching image size.
>>
>
> Sorry I never got back to you about this.  The code I was thinking of is in
> http://trac.webkit.org/**browser/trunk/Source/WebKit/**
>
chromium/src/WebImageSkia.cpp<http://trac.webkit.org/browser/trunk/Source/WebKit/chromium/src/WebImageSkia.cpp>
> in WebImage::fromData().  It sounds like it probably is not that useful to
> you.
>
>
http://codereview.chromium.**org/9696057/<http://codereview.chromium.org/9696...
>

Powered by Google App Engine
This is Rietveld 408576698