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

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

Issue 2778513002: Delete JumpListIconsOld and update revised links in every update (Closed)
Patch Set: Update jumplist links anyway Created 3 years, 9 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_file_util.h » ('j') | chrome/browser/win/jumplist_file_util.h » ('J')
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 af8b85740eece98290c83dfe4b35dced83cecdd8..b4edf4b679214ef3b399522546fa8a221ace7897 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -4,8 +4,6 @@
#include "chrome/browser/win/jumplist.h"
-#include <Shlwapi.h>
-
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
@@ -260,30 +258,31 @@ void RunUpdateOnFileThread(
UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIcons",
delete_status, END);
- // If JumpListIcons directory is not empty, skip jumplist update and return
- // early. If the directory doesn't exist which shouldn't though, try to create
- // a new JumpListIcons directory. If the creation fails, return early.
- if (base::DirectoryExists(icon_dir)) {
- DirectoryEmptyStatus empty_status =
- ::PathIsDirectoryEmpty(icon_dir.value().c_str()) ? EMPTY : NON_EMPTY;
- UMA_HISTOGRAM_ENUMERATION("WinJumplist.EmptyStatusJumpListIcons",
- empty_status, EMPTY_STATUS_END);
- if (empty_status == NON_EMPTY)
- return;
- } else if (!base::CreateDirectory(icon_dir)) {
- return;
- }
+ // If JumpListIcons directory is not empty, skip updating the jumplist icons.
+ // If the directory doesn't exist which shouldn't though, try to create
+ // a new JumpListIcons directory. If the creation fails, skip updating the
+ // jumplist icons. The jumplist links should be updated anyway, as it doesn't
+ // involve disk IO.
- // Create temporary icon files for shortcuts in the "Most Visited" category.
- CreateIconFiles(icon_dir, local_most_visited_pages);
+ DirectoryStatus dir_status = NON_EXIST;
+ if (base::DirectoryExists(icon_dir))
+ dir_status = base::IsDirectoryEmpty(icon_dir) ? EMPTY : NON_EMPTY;
- // Create temporary icon files for shortcuts in the "Recently Closed"
- // category.
- CreateIconFiles(icon_dir, local_recently_closed_pages);
+ if (dir_status == NON_EXIST && base::CreateDirectory(icon_dir))
+ dir_status = EMPTY;
+
grt (UTC plus 2) 2017/03/27 19:18:47 UMA WinJumplist.DirectoryStatusJumpListIcons here?
chengx 2017/03/27 20:26:08 Ah, my bad. Now it is back.
+ if (dir_status == EMPTY) {
+ // Create temporary icon files for shortcuts in the "Most Visited" category.
grt (UTC plus 2) 2017/03/27 19:18:47 the files aren't really temporary, are they? their
chengx 2017/03/27 20:26:08 Those are old comments existed for a very long tim
+ CreateIconFiles(icon_dir, local_most_visited_pages);
+
+ // Create temporary icon files for shortcuts in the "Recently Closed"
+ // category.
+ CreateIconFiles(icon_dir, local_recently_closed_pages);
+ }
- // We finished collecting all resources needed for updating an application
- // JumpList. So, create a new JumpList and replace the current JumpList
- // with it.
+ // Create a new JumpList and replace the current JumpList with it. The
+ // jumplist links are updated anyway, while the jumplist icons may not as
+ // mentioned above.
UpdateJumpList(app_id.c_str(), local_most_visited_pages,
local_recently_closed_pages, incognito_availability);
« no previous file with comments | « no previous file | chrome/browser/win/jumplist_file_util.h » ('j') | chrome/browser/win/jumplist_file_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698