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

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

Issue 2896233003: Cancel the JumpList update if top 5 most visited URLs are unchanged (Closed)
Patch Set: Add unittest 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
Index: chrome/browser/win/jumplist.cc
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc
index f019dab9dcfb3f14f4dcd879744fd2103ea79438..b3a129df7dafc81654fd33aa5db7907a20e9d6e5 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/shell_integration_win.h"
#include "chrome/browser/win/jumplist_file_util.h"
+#include "chrome/browser/win/jumplist_update_util.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/common/chrome_switches.h"
@@ -292,6 +293,13 @@ void JumpList::OnMostVisitedURLsAvailable(
{
JumpListData* data = &jumplist_data_->data;
base::AutoLock auto_lock(data->list_lock_);
+
+ // There is no need to update the JumpList if the top most visited sites in
+ // display have not changed.
+ if (MostVisitedItemsUnchanged(data->most_visited_pages_, urls,
+ kMostVisitedItems))
grt (UTC plus 2) 2017/05/30 08:51:41 nit: add braces for multi-line conditional
chengx 2017/05/30 19:37:01 Done.
+ return;
+
data->most_visited_pages_.clear();
for (size_t i = 0; i < urls.size() && i < kMostVisitedItems; i++) {

Powered by Google App Engine
This is Rietveld 408576698