refactor: make shell.ShowItemInFolder asynchronous (#17121)
* fix: add scoped_blocking_calls to platform_win
1191582
* feat: make ShowItemInFolder async
* address feedback from review
* fix build
This commit is contained in:
parent
08066581b0
commit
5ecda17c7a
5 changed files with 40 additions and 39 deletions
|
@ -59,7 +59,7 @@ NSString* GetLoginHelperBundleIdentifier() {
|
|||
|
||||
namespace platform_util {
|
||||
|
||||
bool ShowItemInFolder(const base::FilePath& path) {
|
||||
void ShowItemInFolder(const base::FilePath& path) {
|
||||
// The API only takes absolute path.
|
||||
base::FilePath full_path =
|
||||
path.IsAbsolute() ? path : base::MakeAbsoluteFilePath(path);
|
||||
|
@ -69,9 +69,7 @@ bool ShowItemInFolder(const base::FilePath& path) {
|
|||
if (!path_string || ![[NSWorkspace sharedWorkspace] selectFile:path_string
|
||||
inFileViewerRootedAtPath:@""]) {
|
||||
LOG(WARNING) << "NSWorkspace failed to select file " << full_path.value();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenItem(const base::FilePath& full_path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue