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());
}
.SetMethod("setImage", &Tray::SetImage)
.SetMethod("setPressedImage", &Tray::SetPressedImage)
.SetMethod("setToolTip", &Tray::SetToolTip)
+ .SetMethod("setTitle", &Tray::SetTitle)
.SetMethod("_setContextMenu", &Tray::SetContextMenu);
}
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:
TrayIcon::~TrayIcon() {
}
+void TrayIcon::SetTitle(const std::string& title) {
+}
+
void TrayIcon::NotifyClicked() {
FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnClicked());
}
// status icon (e.g. Ubuntu Unity).
virtual void SetToolTip(const std::string& tool_tip) = 0;
+ // Sets the title displayed aside of the status icon in the status bar. This
+ // only works on OS X.
+ virtual void SetTitle(const std::string& title);
+
// Set the context menu for this icon.
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) = 0;
virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE;
virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE;
virtual void SetToolTip(const std::string& tool_tip) OVERRIDE;
+ virtual void SetTitle(const std::string& title) OVERRIDE;
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE;
private:
[item_ setToolTip:base::SysUTF8ToNSString(tool_tip)];
}
+void TrayIconCocoa::SetTitle(const std::string& title) {
+ [item_ setTitle:base::SysUTF8ToNSString(title)];
+}
+
void TrayIconCocoa::SetContextMenu(ui::SimpleMenuModel* menu_model) {
menu_.reset([[AtomMenuController alloc] initWithModel:menu_model]);
[item_ setMenu:[menu_ menu]];