Index: chrome/browser/win/jumplist.h |
diff --git a/chrome/browser/win/jumplist.h b/chrome/browser/win/jumplist.h |
index c4b6c857584430198509a89a08b224963d7fb3e0..125cd533a8e5a915ae5caecf0ea96eaf1f95eafd 100644 |
--- a/chrome/browser/win/jumplist.h |
+++ b/chrome/browser/win/jumplist.h |
@@ -12,6 +12,7 @@ |
#include <string> |
#include <utility> |
+#include "base/containers/flat_map.h" |
#include "base/files/file_path.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
@@ -32,6 +33,8 @@ |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
+enum JumpListCategory { MOST_VISITED = 0, RECENTLY_CLOSED }; |
grt (UTC plus 2)
2017/05/11 20:29:13
nit: Chromium no longer deviates from the Google s
grt (UTC plus 2)
2017/05/11 20:29:13
move this type into the "private:" section of the
grt (UTC plus 2)
2017/05/11 20:29:13
nit: "enum class"
chengx
2017/05/12 01:04:24
Done with moving to private section of the class.
chengx
2017/05/12 01:04:24
Done with changing names to kLikeAConstant alike.
chengx
2017/05/12 01:04:24
Done. Using "enum class" now.
|
+ |
namespace base { |
class SingleThreadTaskRunner; |
class SequencedTaskRunner; |
@@ -179,17 +182,23 @@ class JumpList : public sessions::TabRestoreServiceObserver, |
// after requests storms have subsided. |
void DeferredTabRestoreServiceChanged(); |
+ // Deletes icon files in |icon_dir| which are not in the cache anymore. |
+ void DeleteIconFiles(const base::FilePath& icon_dir, |
+ JumpListCategory category); |
+ |
// Creates at most |max_items| icon files in |icon_dir| for the |
// asynchrounously loaded icons stored in |item_list|. |
void CreateIconFiles(const base::FilePath& icon_dir, |
const ShellLinkItemList& item_list, |
- size_t max_items); |
+ size_t max_items, |
+ JumpListCategory category); |
// Updates icon files in |icon_dir|, which includes deleting old icons and |
// creating at most |slot_limit| new icons for |page_list|. |
void UpdateIconFiles(const base::FilePath& icon_dir, |
const ShellLinkItemList& page_list, |
- size_t slot_limit); |
+ size_t slot_limit, |
+ JumpListCategory category); |
// Updates the jumplist, once all the data has been fetched. This method calls |
// UpdateJumpList() to do most of the work. |
@@ -216,7 +225,7 @@ class JumpList : public sessions::TabRestoreServiceObserver, |
// Tracks FaviconService tasks. |
base::CancelableTaskTracker cancelable_task_tracker_; |
- // The Profile object is used to listen for events |
+ // The Profile object is used to listen for events. |
Profile* profile_; |
// Lives on the UI thread. |
@@ -236,6 +245,11 @@ class JumpList : public sessions::TabRestoreServiceObserver, |
// Holds data that can be accessed from multiple threads. |
scoped_refptr<base::RefCountedData<JumpListData>> jumplist_data_; |
+ // Cache of the mappings from JumpList items' URLs to icon file paths for |
+ // "Most visited" and "Recently closed" categories, respectively. |
+ base::flat_map<std::string, base::FilePath> most_visited_map_; |
+ base::flat_map<std::string, base::FilePath> recently_closed_map_; |
+ |
// Id of last favicon task. It's used to cancel current task if a new one |
// comes in before it finishes. |
base::CancelableTaskTracker::TaskId task_id_; |