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

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

Issue 2896233003: Cancel the JumpList update if top 5 most visited URLs are unchanged (Closed)
Patch Set: Fix nits 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 | « chrome/browser/BUILD.gn ('k') | chrome/browser/win/jumplist_file_util.h » ('j') | 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 f8da8be172e88cdb77d961a885c38001c518081f..281ea908aac175a6faee31b360ccbd9be343e251 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"
@@ -98,7 +99,7 @@ void AppendCommonSwitches(ShellLinkItem* shell_link) {
// Creates a ShellLinkItem preloaded with common switches.
scoped_refptr<ShellLinkItem> CreateShellLink() {
- scoped_refptr<ShellLinkItem> link(new ShellLinkItem);
+ auto link = base::MakeRefCounted<ShellLinkItem>();
AppendCommonSwitches(link.get());
return link;
}
@@ -292,6 +293,14 @@ 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)) {
+ return;
+ }
+
data->most_visited_pages_.clear();
for (size_t i = 0; i < urls.size() && i < kMostVisitedItems; i++) {
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/win/jumplist_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698