mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add shell.beep() API.
This commit is contained in:
@@ -80,12 +80,19 @@ v8::Handle<v8::Value> Shell::MoveItemToTrash(const v8::Arguments &args) {
|
||||
return v8::Undefined();
|
||||
}
|
||||
|
||||
// static
|
||||
v8::Handle<v8::Value> Shell::Beep(const v8::Arguments &args) {
|
||||
platform_util::Beep();
|
||||
return v8::Undefined();
|
||||
}
|
||||
|
||||
// static
|
||||
void Shell::Initialize(v8::Handle<v8::Object> target) {
|
||||
node::SetMethod(target, "showItemInFolder", ShowItemInFolder);
|
||||
node::SetMethod(target, "openItem", OpenItem);
|
||||
node::SetMethod(target, "openExternal", OpenExternal);
|
||||
node::SetMethod(target, "moveItemToTrash", MoveItemToTrash);
|
||||
node::SetMethod(target, "beep", Beep);
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
||||
@@ -21,6 +21,7 @@ class Shell {
|
||||
static v8::Handle<v8::Value> OpenItem(const v8::Arguments &args);
|
||||
static v8::Handle<v8::Value> OpenExternal(const v8::Arguments &args);
|
||||
static v8::Handle<v8::Value> MoveItemToTrash(const v8::Arguments &args);
|
||||
static v8::Handle<v8::Value> Beep(const v8::Arguments &args);
|
||||
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(Shell);
|
||||
};
|
||||
|
||||
@@ -28,6 +28,8 @@ void OpenExternal(const GURL& url);
|
||||
// Move a file to trash.
|
||||
void MoveItemToTrash(const base::FilePath& full_path);
|
||||
|
||||
void Beep();
|
||||
|
||||
} // platform_util
|
||||
|
||||
#endif // ATOM_COMMON_PLATFORM_UTIL_H_
|
||||
|
||||
@@ -141,4 +141,8 @@ void MoveItemToTrash(const base::FilePath& full_path) {
|
||||
<< " to trash";
|
||||
}
|
||||
|
||||
void Beep() {
|
||||
NSBeep();
|
||||
}
|
||||
|
||||
} // namespace platform_util
|
||||
|
||||
Reference in New Issue
Block a user