Shell openExternal can take optional callback (macOS)

This commit is contained in:
Gabriel Handford 2016-10-13 13:28:11 -07:00 committed by Cheng Zhao
parent 1b5b29901c
commit b266533dfc
6 changed files with 85 additions and 10 deletions

View file

@ -6,6 +6,7 @@
#define ATOM_COMMON_PLATFORM_UTIL_H_
#include "build/build_config.h"
#include "base/callback_forward.h"
#if defined(OS_WIN)
#include "base/strings/string16.h"
@ -27,6 +28,8 @@ bool ShowItemInFolder(const base::FilePath& full_path);
// Must be called from the UI thread.
bool OpenItem(const base::FilePath& full_path);
typedef base::Callback<void(bool opened)> OpenExternalCallback;
// Open the given external protocol URL in the desktop's default manner.
// (For example, mailto: URLs in the default mail user agent.)
bool OpenExternal(
@ -37,6 +40,15 @@ bool OpenExternal(
#endif
bool activate);
bool OpenExternal(
#if defined(OS_WIN)
const base::string16& url,
#else
const GURL& url,
#endif
bool activate,
const OpenExternalCallback& callback);
// Move a file to trash.
bool MoveItemToTrash(const base::FilePath& full_path);