Callback uses (platform specific) error, with message
This commit is contained in:
parent
5e8059e0fa
commit
99a5258999
5 changed files with 83 additions and 35 deletions
|
@ -89,12 +89,16 @@ bool OpenExternal(const GURL& url, bool activate) {
|
|||
return XDGOpen(url.spec(), false);
|
||||
}
|
||||
|
||||
bool OpenExternal(const GURL& url, bool activate,
|
||||
void OpenExternal(const GURL& url, bool activate,
|
||||
const OpenExternalCallback& callback) {
|
||||
// TODO(gabriel): Implement async open if callback is specified
|
||||
bool opened = OpenExternal(url, activate);
|
||||
callback.Run(opened);
|
||||
return opened;
|
||||
if (!opened) {
|
||||
callback.Run(v8::Exception::Error(
|
||||
v8::String::NewFromUtf8(isolate, @"Failed to open")));
|
||||
} else {
|
||||
callback.Run(v8::Null(isolate);)
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveItemToTrash(const base::FilePath& full_path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue