Also fix the Windows and Linux side of async openExternal
This commit is contained in:
parent
090a5d9a61
commit
5639faf069
2 changed files with 2 additions and 16 deletions
|
@ -92,14 +92,7 @@ bool OpenExternal(const GURL& url, bool activate) {
|
||||||
void OpenExternal(const GURL& url, bool activate,
|
void OpenExternal(const GURL& url, bool activate,
|
||||||
const OpenExternalCallback& callback) {
|
const OpenExternalCallback& callback) {
|
||||||
// TODO(gabriel): Implement async open if callback is specified
|
// TODO(gabriel): Implement async open if callback is specified
|
||||||
bool opened = OpenExternal(url, activate);
|
callback.Run(OpenExternal(url, activate) ? "" : "Failed to open");
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MoveItemToTrash(const base::FilePath& full_path) {
|
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,
|
void OpenExternal(const base::string16& url, bool activate,
|
||||||
const OpenExternalCallback& callback) {
|
const OpenExternalCallback& callback) {
|
||||||
// TODO(gabriel): Implement async open if callback is specified
|
// TODO(gabriel): Implement async open if callback is specified
|
||||||
bool opened = OpenExternal(url, activate);
|
callback.Run(OpenExternal(url, activate) ? "" : "Failed to open");
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MoveItemToTrash(const base::FilePath& path) {
|
bool MoveItemToTrash(const base::FilePath& path) {
|
||||||
|
|
Loading…
Reference in a new issue