#import <Cocoa/Cocoa.h>
#include "base/files/file_path.h"
+#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/mac/mac_logging.h"
#include "base/mac/scoped_aedesc.h"
namespace platform_util {
-void ShowItemInFolder(const base::FilePath& full_path) {
+void ShowItemInFolder(const base::FilePath& path) {
+ // The API only takes absolute path.
+ base::FilePath full_path =
+ path.IsAbsolute() ? path : base::MakeAbsoluteFilePath(path);
+
DCHECK([NSThread isMainThread]);
NSString* path_string = base::SysUTF8ToNSString(full_path.value());
if (!path_string || ![[NSWorkspace sharedWorkspace] selectFile:path_string