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

Unified Diff: chrome/browser/win/jumplist.cc

Issue 2907513002: [Code cleaning] Change hard-coded constants to predefined constant variables in JumpList (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist.cc
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc
index 7f8ecf1257bda62023d10ea3bf2b181b72fe7a6c..f019dab9dcfb3f14f4dcd879744fd2103ea79438 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -60,7 +60,7 @@ namespace {
// https://msdn.microsoft.com/library/windows/desktop/dd378398.aspx
// The "Most visited" and "Recently closed" category titles always take 2 slots.
// For the remaining 8 slots, we allocate 5 slots to "most-visited" items and 3
-// slots to"recently-closed" items, respectively.
+// slots to "recently-closed" items, respectively.
constexpr size_t kMostVisitedItems = 5;
constexpr size_t kRecentlyClosedItems = 3;
@@ -686,8 +686,11 @@ int JumpList::UpdateIconFiles(const base::FilePath& icon_dir,
JumpListCategory category) {
int icons_created = 0;
- // Maximum number of icon files that each JumpList icon folder may hold.
- size_t icon_limit = (category == JumpListCategory::kMostVisited) ? 10 : 6;
+ // Maximum number of icon files that each JumpList icon folder may hold, which
+ // is set to 2 times the normal amount.
+ size_t icon_limit =
+ 2 * ((category == JumpListCategory::kMostVisited) ? kMostVisitedItems
+ : kRecentlyClosedItems);
// Clear the JumpList icon folder at |icon_dir| and the cache when
// 1) "Most visited" category updates for the 1st time after Chrome is
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698