Chromium Code Reviews| Index: chrome/browser/win/jumplist.cc |
| diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc |
| index 6dad5579697389d68a137d050de08c7ae6b97199..d1d132601f1398c876c09d1e938364c2f8029972 100644 |
| --- a/chrome/browser/win/jumplist.cc |
| +++ b/chrome/browser/win/jumplist.cc |
| @@ -240,6 +240,9 @@ bool UpdateJumpList(const wchar_t* app_id, |
| recently_closed_items = recently_closed_pages.size(); |
| } |
| + // Record the number of icons created per JumpList update. |
|
grt (UTC plus 2)
2017/05/01 08:44:38
nit:
// Record the desired number of icons to cr
chengx
2017/05/01 18:08:22
Done.
|
| + int icons_to_create = 0; |
| + |
| if (most_visited_pages_have_updates) { |
| // Delete the content in JumpListIconsMostVisited folder and log the results |
| // to UMA. |
| @@ -259,6 +262,9 @@ bool UpdateJumpList(const wchar_t* app_id, |
| // Create icon files for shortcuts in the "Most Visited" category. |
| CreateIconFiles(icon_dir_most_visited, most_visited_pages, |
| most_visited_items); |
| + |
| + icons_to_create += |
| + std::min(most_visited_pages.size(), most_visited_items); |
| } |
| } |
| @@ -276,10 +282,16 @@ bool UpdateJumpList(const wchar_t* app_id, |
| // Create icon files for shortcuts in the "Recently Closed" category. |
| CreateIconFiles(icon_dir_recent_closed, recently_closed_pages, |
| recently_closed_items); |
| + |
| + icons_to_create += |
| + std::min(recently_closed_pages.size(), recently_closed_items); |
| } |
| } |
| // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. |
| + UMA_HISTOGRAM_COUNTS_100("WinJumplist.CreateIconFilesCount", icons_to_create); |
| + |
| + // TODO(chengx): Remove the UMA histogram after fixing http://crbug.com/40407. |
| SCOPED_UMA_HISTOGRAM_TIMER("WinJumplist.UpdateJumpListDuration"); |
| // Update the "Most Visited" category of the JumpList if it exists. |