fix: don't fallback to OpenFolderViaShell (#21668)
This commit is contained in:
parent
c0bde4baa4
commit
19ef7a0fc9
1 changed files with 2 additions and 7 deletions
|
@ -272,19 +272,15 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) {
|
||||||
hr = desktop->ParseDisplayName(NULL, NULL,
|
hr = desktop->ParseDisplayName(NULL, NULL,
|
||||||
const_cast<wchar_t*>(dir.value().c_str()),
|
const_cast<wchar_t*>(dir.value().c_str()),
|
||||||
NULL, &dir_item, NULL);
|
NULL, &dir_item, NULL);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr))
|
||||||
ui::win::OpenFolderViaShell(dir);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
base::win::ScopedCoMem<ITEMIDLIST> file_item;
|
base::win::ScopedCoMem<ITEMIDLIST> file_item;
|
||||||
hr = desktop->ParseDisplayName(
|
hr = desktop->ParseDisplayName(
|
||||||
NULL, NULL, const_cast<wchar_t*>(full_path.value().c_str()), NULL,
|
NULL, NULL, const_cast<wchar_t*>(full_path.value().c_str()), NULL,
|
||||||
&file_item, NULL);
|
&file_item, NULL);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr))
|
||||||
ui::win::OpenFolderViaShell(dir);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
const ITEMIDLIST* highlight[] = {file_item};
|
const ITEMIDLIST* highlight[] = {file_item};
|
||||||
hr = SHOpenFolderAndSelectItems(dir_item, base::size(highlight), highlight,
|
hr = SHOpenFolderAndSelectItems(dir_item, base::size(highlight), highlight,
|
||||||
|
@ -299,7 +295,6 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) {
|
||||||
LOG(WARNING) << " " << __func__ << "(): Can't open full_path = \""
|
LOG(WARNING) << " " << __func__ << "(): Can't open full_path = \""
|
||||||
<< full_path.value() << "\""
|
<< full_path.value() << "\""
|
||||||
<< " hr = " << logging::SystemErrorCodeToString(hr);
|
<< " hr = " << logging::SystemErrorCodeToString(hr);
|
||||||
ui::win::OpenFolderViaShell(dir);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue