Fix the number of JumpList slots assigned to each JumpList category

By default, the maximum number of items to display in JumpList is 10
per Windows. Previously, we considered there'are 10 available JumpList
slots, and we assign these slots to "Most visit" and "Recently closed"
categories accordingly. However, each category title takes one slot.
Therefore, the number of JumpList slots assigned to each category is
incorrect. This caused bug 714925, "Recently closed category of
JumpList won't show up until closing three websites instead of one".

To fix this, we need to adjust the number of available JumpList slots
based on the presence of the two JumpList categories. If one of the
categories presents, there'll be one available slot less. If both
categories present, there'll be two available slots less.

Since now the number of available slots is 1 or 2 less as it should
be, we're now deleting and creating 1 or 2 less icons per JumpList
update. This saves some disk IO. Note that the current implementation
deletes 10 icons followed by creating 10 icons per JumpList update.

BUG=714925, 40407, 179576

Review-Url: https://codereview.chromium.org/2844463003
Cr-Commit-Position: refs/heads/master@{#467094}
1 file changed