mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Also fix the Windows and Linux side of async openExternal
This commit is contained in:
@@ -92,14 +92,7 @@ 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);
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
if (!opened) {
|
||||
callback.Run(v8::Exception::Error(
|
||||
v8::String::NewFromUtf8(isolate, "Failed to open")));
|
||||
} else {
|
||||
callback.Run(v8::Null(isolate));
|
||||
}
|
||||
callback.Run(OpenExternal(url, activate) ? "" : "Failed to open");
|
||||
}
|
||||
|
||||
bool MoveItemToTrash(const base::FilePath& full_path) {
|
||||
|
||||
@@ -319,14 +319,7 @@ bool OpenExternal(const base::string16& url, bool activate) {
|
||||
void OpenExternal(const base::string16& url, bool activate,
|
||||
const OpenExternalCallback& callback) {
|
||||
// TODO(gabriel): Implement async open if callback is specified
|
||||
bool opened = OpenExternal(url, activate);
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
if (!opened) {
|
||||
callback.Run(v8::Exception::Error(
|
||||
v8::String::NewFromUtf8(isolate, "Failed to open")));
|
||||
} else {
|
||||
callback.Run(v8::Null(isolate));
|
||||
}
|
||||
callback.Run(OpenExternal(url, activate) ? "" : "Failed to open");
|
||||
}
|
||||
|
||||
bool MoveItemToTrash(const base::FilePath& path) {
|
||||
|
||||
Reference in New Issue
Block a user