mac: Add Tray.setTitle API, fixes #560.

This commit is contained in:
Cheng Zhao 2014-09-09 19:33:58 +08:00
parent db8de9e60d
commit 4330d67e0d
6 changed files with 18 additions and 0 deletions

View file

@ -48,6 +48,10 @@ void Tray::SetToolTip(const std::string& tool_tip) {
tray_icon_->SetToolTip(tool_tip);
}
void Tray::SetTitle(const std::string& title) {
tray_icon_->SetTitle(title);
}
void Tray::SetContextMenu(Menu* menu) {
tray_icon_->SetContextMenu(menu->model());
}
@ -59,6 +63,7 @@ void Tray::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setImage", &Tray::SetImage)
.SetMethod("setPressedImage", &Tray::SetPressedImage)
.SetMethod("setToolTip", &Tray::SetToolTip)
.SetMethod("setTitle", &Tray::SetTitle)
.SetMethod("_setContextMenu", &Tray::SetContextMenu);
}

View file

@ -41,6 +41,7 @@ class Tray : public mate::EventEmitter,
void SetImage(const gfx::ImageSkia& image);
void SetPressedImage(const gfx::ImageSkia& image);
void SetToolTip(const std::string& tool_tip);
void SetTitle(const std::string& title);
void SetContextMenu(Menu* menu);
private: