| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/win/jumplist.h" | 5 #include "chrome/browser/win/jumplist.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 // static | 656 // static |
| 657 void JumpList::RunUpdateJumpList( | 657 void JumpList::RunUpdateJumpList( |
| 658 const base::string16& app_id, | 658 const base::string16& app_id, |
| 659 const base::FilePath& profile_dir, | 659 const base::FilePath& profile_dir, |
| 660 const ShellLinkItemList& most_visited_pages, | 660 const ShellLinkItemList& most_visited_pages, |
| 661 const ShellLinkItemList& recently_closed_pages, | 661 const ShellLinkItemList& recently_closed_pages, |
| 662 bool most_visited_should_update, | 662 bool most_visited_should_update, |
| 663 bool recently_closed_should_update, | 663 bool recently_closed_should_update, |
| 664 IncognitoModePrefs::Availability incognito_availability, | 664 IncognitoModePrefs::Availability incognito_availability, |
| 665 UpdateTransaction* update_transaction) { | 665 UpdateTransaction* update_transaction) { |
| 666 if (!JumpListUpdater::IsEnabled()) | |
| 667 return; | |
| 668 | |
| 669 DCHECK(update_transaction); | 666 DCHECK(update_transaction); |
| 670 | 667 |
| 671 base::FilePath most_visited_icon_dir = GenerateJumplistIconDirName( | 668 base::FilePath most_visited_icon_dir = GenerateJumplistIconDirName( |
| 672 profile_dir, FILE_PATH_LITERAL("MostVisited")); | 669 profile_dir, FILE_PATH_LITERAL("MostVisited")); |
| 673 base::FilePath recently_closed_icon_dir = GenerateJumplistIconDirName( | 670 base::FilePath recently_closed_icon_dir = GenerateJumplistIconDirName( |
| 674 profile_dir, FILE_PATH_LITERAL("RecentClosed")); | 671 profile_dir, FILE_PATH_LITERAL("RecentClosed")); |
| 675 | 672 |
| 676 CreateNewJumpListAndNotifyOS( | 673 CreateNewJumpListAndNotifyOS( |
| 677 app_id, most_visited_icon_dir, recently_closed_icon_dir, | 674 app_id, most_visited_icon_dir, recently_closed_icon_dir, |
| 678 most_visited_pages, recently_closed_pages, most_visited_should_update, | 675 most_visited_pages, recently_closed_pages, most_visited_should_update, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 const URLIconCache& icons_cache) { | 863 const URLIconCache& icons_cache) { |
| 867 // Put all cached icon file paths into a set. | 864 // Put all cached icon file paths into a set. |
| 868 base::flat_set<base::FilePath> cached_files; | 865 base::flat_set<base::FilePath> cached_files; |
| 869 cached_files.reserve(icons_cache.size()); | 866 cached_files.reserve(icons_cache.size()); |
| 870 | 867 |
| 871 for (const auto& url_path_pair : icons_cache) | 868 for (const auto& url_path_pair : icons_cache) |
| 872 cached_files.insert(url_path_pair.second); | 869 cached_files.insert(url_path_pair.second); |
| 873 | 870 |
| 874 DeleteNonCachedFiles(icon_dir, cached_files); | 871 DeleteNonCachedFiles(icon_dir, cached_files); |
| 875 } | 872 } |
| OLD | NEW |