 Chromium Code Reviews
 Chromium Code Reviews Issue 2836873003:
  Update different JumpList categories on demand  (Closed)
    
  
    Issue 2836873003:
  Update different JumpList categories on demand  (Closed) 
  | Index: chrome/browser/win/jumplist.h | 
| diff --git a/chrome/browser/win/jumplist.h b/chrome/browser/win/jumplist.h | 
| index 0279af26e198153fccf2f13c6de8a501aa8f4cfa..bfba81e938c180e934eee240013e240296f129ba 100644 | 
| --- a/chrome/browser/win/jumplist.h | 
| +++ b/chrome/browser/win/jumplist.h | 
| @@ -84,6 +84,14 @@ 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. | 
| + bool most_visited_pages_have_updates_; | 
| + | 
| + // A boolean flag indicating if "Recently Closed" category of the JumpList | 
| + // has new updates therefore its icons need to be updated. | 
| + bool recently_closed_pages_have_updates_; | 
| }; | 
| // Observer callback for TabRestoreService::Observer to notify when a tab is | 
| @@ -115,15 +123,16 @@ 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. | 
| + // AddTab creates a ShellLinkItem object from a tab and add it to |data|. | 
| 
grt (UTC plus 2)
2017/04/27 09:05:25
better yet:
  // Adds a new ShellLinkItem for |tab
 
grt (UTC plus 2)
2017/04/27 09:05:25
nit: add -> adds
 
grt (UTC plus 2)
2017/04/27 09:05:25
nit: "Creates a ShellLinkItem..."
 
chengx
2017/04/27 17:21:11
Done.
 
chengx
2017/04/27 17:21:11
Done.
 
chengx
2017/04/27 17:21:11
Done.
 | 
| bool AddTab(const sessions::TabRestoreService::Tab& tab, | 
| - ShellLinkItemList* list, | 
| + JumpListData* data, | 
| 
grt (UTC plus 2)
2017/04/27 09:05:25
nit: out params must follow all in params (https:/
 
chengx
2017/04/27 17:21:11
Done. Thanks for pointing me to this.
 | 
| size_t max_items); | 
| + // Creates a ShellLinkItem object for each tab in the given |window| and add | 
| + // to |data|. | 
| void AddWindow(const sessions::TabRestoreService::Window& window, | 
| - ShellLinkItemList* list, | 
| + JumpListData* data, | 
| size_t max_items); | 
| // Starts loading a favicon for each URL in |icon_urls_|. | 
| @@ -186,11 +195,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_; |