OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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_file_util.h" | 5 #include "chrome/browser/win/jumplist_file_util.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // if it is. | 102 // if it is. |
103 if (base::IsDirectoryEmpty(path) && | 103 if (base::IsDirectoryEmpty(path) && |
104 !::RemoveDirectory(path.value().c_str())) { | 104 !::RemoveDirectory(path.value().c_str())) { |
105 delete_status = FAIL_REMOVE_RAW_DIRECTORY; | 105 delete_status = FAIL_REMOVE_RAW_DIRECTORY; |
106 } | 106 } |
107 return delete_status; | 107 return delete_status; |
108 } | 108 } |
109 | 109 |
110 void DeleteDirectoryAndLogResults(const base::FilePath& path, | 110 void DeleteDirectoryAndLogResults(const base::FilePath& path, |
111 int max_file_deleted) { | 111 int max_file_deleted) { |
112 FolderDeleteResult delete_status = DeleteDirectory(path, max_file_deleted); | 112 DirectoryStatus dir_status = NON_EXIST; |
113 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIconsOld", | |
114 delete_status, END); | |
115 | 113 |
116 DirectoryStatus dir_status = NON_EXIST; | 114 if (base::DirectoryExists(path)) { |
117 if (base::DirectoryExists(path)) | 115 FolderDeleteResult delete_status = DeleteDirectory(path, max_file_deleted); |
| 116 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DeleteStatusJumpListIconsOld", |
| 117 delete_status, FolderDeleteResult::END); |
118 dir_status = base::IsDirectoryEmpty(path) ? EMPTY : NON_EMPTY; | 118 dir_status = base::IsDirectoryEmpty(path) ? EMPTY : NON_EMPTY; |
| 119 } |
119 | 120 |
120 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DirectoryStatusJumpListIconsOld", | 121 UMA_HISTOGRAM_ENUMERATION("WinJumplist.DirectoryStatusJumpListIconsOld", |
121 dir_status, DIRECTORY_STATUS_END); | 122 dir_status, DIRECTORY_STATUS_END); |
122 } | 123 } |
OLD | NEW |