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

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

Issue 2836873003: Update different JumpList categories on demand (Closed)
Patch Set: Fix nits Created 3 years, 8 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 | chrome/browser/win/jumplist.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist.h
diff --git a/chrome/browser/win/jumplist.h b/chrome/browser/win/jumplist.h
index 0279af26e198153fccf2f13c6de8a501aa8f4cfa..975320ef416ee6fc56a8689f49952af6a382a82d 100644
--- a/chrome/browser/win/jumplist.h
+++ b/chrome/browser/win/jumplist.h
@@ -84,6 +84,18 @@ class JumpList : public sessions::TabRestoreServiceObserver,
// Items in the "Recently Closed" category of the application JumpList,
// protected by the list_lock_.
ShellLinkItemList recently_closed_pages_;
+
+ // A boolean flag indicating if "Most Visited" category of the JumpList
+ // has new updates therefore its icons need to be updated.
+ // By default, this flag is set to false. If there's any change in
+ // TabRestoreService, this flag will be set to true.
+ bool most_visited_pages_have_updates_ = false;
+
+ // A boolean flag indicating if "Recently Closed" category of the JumpList
+ // has new updates therefore its icons need to be updated.
+ // By default, this flag is set to false. If there's any change in TopSites
+ // service, this flag will be set to true.
+ bool recently_closed_pages_have_updates_ = false;
};
// Observer callback for TabRestoreService::Observer to notify when a tab is
@@ -115,16 +127,20 @@ class JumpList : public sessions::TabRestoreServiceObserver,
explicit JumpList(Profile* profile); // Use JumpListFactory instead
~JumpList() override;
- // Creates a ShellLinkItem object from a tab (or a window) and add it to the
- // given list.
- // These functions are copied from the RecentlyClosedTabsHandler class for
- // compatibility with the new-tab page.
+ // The AddTab and AddWindow functions are copied from the
+ // RecentlyClosedTabsHandler class for compatibility with the new-tab page.
+
+ // Adds a new ShellLinkItem for |tab| to |data| provided that doing so will
+ // not exceed |max_items|.
bool AddTab(const sessions::TabRestoreService::Tab& tab,
- ShellLinkItemList* list,
- size_t max_items);
+ size_t max_items,
+ JumpListData* data);
+
+ // Adds a new ShellLinkItem for each tab in |window| to |data| provided that
+ // doing so will not exceed |max_items|.
void AddWindow(const sessions::TabRestoreService::Window& window,
- ShellLinkItemList* list,
- size_t max_items);
+ size_t max_items,
+ JumpListData* data);
// Starts loading a favicon for each URL in |icon_urls_|.
// This function sends a query to HistoryService.
@@ -186,11 +202,12 @@ class JumpList : public sessions::TabRestoreServiceObserver,
// comes in before it finishes.
base::CancelableTaskTracker::TaskId task_id_;
- // A task runner running tasks to update the jumplist in JumpListIcons.
- scoped_refptr<base::SingleThreadTaskRunner> update_jumplisticons_task_runner_;
+ // A task runner running tasks to update the JumpList.
+ scoped_refptr<base::SingleThreadTaskRunner> update_jumplist_task_runner_;
- // A task runner running tasks to delete JumpListIconsOld directory.
- scoped_refptr<base::SequencedTaskRunner> delete_jumplisticonsold_task_runner_;
+ // A task runner running tasks to delete JumpListIcons directory and
+ // JumpListIconsOld directory.
+ scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_;
// For callbacks may be run after destruction.
base::WeakPtrFactory<JumpList> weak_ptr_factory_;
« no previous file with comments | « no previous file | chrome/browser/win/jumplist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698