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

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

Issue 2954173002: Remove redundant JumpListUpdater::IsEnabled calls (Closed)
Patch Set: Created 3 years, 6 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 | no next file » | 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 bbca037062d132ddc5c693646170827aee422cee..a366229f79526fea4b2d2f67ed42c41bbe309868 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -266,6 +266,9 @@ void JumpList::TopSitesChanged(history::TopSites* top_sites,
ChangeReason change_reason) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if (!JumpListUpdater::IsEnabled())
grt (UTC plus 2) 2017/06/24 20:42:44 BrowserView::InitViews only constructs a JumpList
chengx 2017/06/29 19:14:37 That should be enough.
+ return;
+
top_sites_has_pending_notification_ = true;
// Postpone handling this notification until a pending update completes.
@@ -282,6 +285,9 @@ void JumpList::TopSitesChanged(history::TopSites* top_sites,
void JumpList::TabRestoreServiceChanged(sessions::TabRestoreService* service) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if (!JumpListUpdater::IsEnabled())
+ return;
+
tab_restore_has_pending_notification_ = true;
// Postpone handling this notification until a pending update completes.
@@ -301,6 +307,9 @@ void JumpList::TabRestoreServiceDestroyed(
void JumpList::OnIncognitoAvailabilityChanged() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if (!JumpListUpdater::IsEnabled())
+ return;
+
if (icon_urls_.empty())
PostRunUpdate();
}
@@ -664,9 +673,6 @@ void JumpList::RunUpdateJumpList(
bool recently_closed_should_update,
IncognitoModePrefs::Availability incognito_availability,
UpdateResults* update_results) {
- if (!JumpListUpdater::IsEnabled())
- return;
-
DCHECK(update_results);
JumpListUpdater jumplist_updater(app_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698