Skip to content

Commit

Permalink
fix: don't fallback to OpenFolderViaShell (#21749)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <codebytere@github.com>
  • Loading branch information
2 people authored and zcbenz committed Jan 13, 2020
1 parent c92efa4 commit ae27218
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions shell/common/platform_util_win.cc
Expand Up @@ -271,19 +271,15 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) {
hr = desktop->ParseDisplayName(NULL, NULL,
const_cast<wchar_t*>(dir.value().c_str()),
NULL, &dir_item, NULL);
if (FAILED(hr)) {
ui::win::OpenFolderViaShell(dir);
if (FAILED(hr))
return;
}

base::win::ScopedCoMem<ITEMIDLIST> file_item;
hr = desktop->ParseDisplayName(
NULL, NULL, const_cast<wchar_t*>(full_path.value().c_str()), NULL,
&file_item, NULL);
if (FAILED(hr)) {
ui::win::OpenFolderViaShell(dir);
if (FAILED(hr))
return;
}

const ITEMIDLIST* highlight[] = {file_item};
hr = SHOpenFolderAndSelectItems(dir_item, base::size(highlight), highlight,
Expand All @@ -298,7 +294,6 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) {
LOG(WARNING) << " " << __func__ << "(): Can't open full_path = \""
<< full_path.value() << "\""
<< " hr = " << logging::SystemErrorCodeToString(hr);
ui::win::OpenFolderViaShell(dir);
}
}
}
Expand Down

0 comments on commit ae27218

Please sign in to comment.