tray_icon_->DisplayBalloon(icon, title, content);
}
-void Tray::PopContextMenu(mate::Arguments* args) {
+void Tray::PopUpContextMenu(mate::Arguments* args) {
gfx::Point pos;
args->GetNext(&pos);
- tray_icon_->PopContextMenu(pos);
+ tray_icon_->PopUpContextMenu(pos);
}
void Tray::SetContextMenu(mate::Arguments* args, Menu* menu) {
.SetMethod("setTitle", &Tray::SetTitle)
.SetMethod("setHighlightMode", &Tray::SetHighlightMode)
.SetMethod("displayBalloon", &Tray::DisplayBalloon)
- .SetMethod("popContextMenu", &Tray::PopContextMenu)
+ .SetMethod("popUpContextMenu", &Tray::PopUpContextMenu)
.SetMethod("_setContextMenu", &Tray::SetContextMenu);
}
void SetTitle(mate::Arguments* args, const std::string& title);
void SetHighlightMode(mate::Arguments* args, bool highlight);
void DisplayBalloon(mate::Arguments* args, const mate::Dictionary& options);
- void PopContextMenu(mate::Arguments* args);
+ void PopUpContextMenu(mate::Arguments* args);
void SetContextMenu(mate::Arguments* args, Menu* menu);
private:
Tray = bindings.Tray
Tray::__proto__ = EventEmitter.prototype
+
Tray::setContextMenu = (menu) ->
@_setContextMenu menu
@menu = menu # Keep a strong reference of menu.
+# Keep compatibility with old APIs.
+Tray::popContextMenu = Tray::popUpContextMenu
+
module.exports = Tray
const base::string16& contents) {
}
-void TrayIcon::PopContextMenu(const gfx::Point& pos) {
+void TrayIcon::PopUpContextMenu(const gfx::Point& pos) {
}
void TrayIcon::NotifyClicked(const gfx::Rect& bounds, int modifiers) {
const base::string16& title,
const base::string16& contents);
- virtual void PopContextMenu(const gfx::Point& pos);
+ virtual void PopUpContextMenu(const gfx::Point& pos);
// Set the context menu for this icon.
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) = 0;
void SetToolTip(const std::string& tool_tip) override;
void SetTitle(const std::string& title) override;
void SetHighlightMode(bool highlight) override;
- void PopContextMenu(const gfx::Point& pos) override;
+ void PopUpContextMenu(const gfx::Point& pos) override;
void SetContextMenu(ui::SimpleMenuModel* menu_model) override;
protected:
[self setNeedsDisplay:YES];
}
-- (void)popContextMenu {
+- (void)popUpContextMenu {
if (menuController_ && ![menuController_ isMenuOpen]) {
// Redraw the dray icon to show highlight if it is enabled.
[self setNeedsDisplay:YES];
[status_item_view_ setHighlight:highlight];
}
-void TrayIconCocoa::PopContextMenu(const gfx::Point& pos) {
- [status_item_view_ popContextMenu];
+void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos) {
+ [status_item_view_ popUpContextMenu];
}
void TrayIconCocoa::SetContextMenu(ui::SimpleMenuModel* menu_model) {
return;
} else if (!double_button_click) { // single right click
if (menu_model_)
- PopContextMenu(cursor_pos);
+ PopUpContextMenu(cursor_pos);
else
NotifyRightClicked(gfx::Rect(rect), modifiers);
}
LOG(WARNING) << "Unable to create status tray balloon.";
}
-void NotifyIcon::PopContextMenu(const gfx::Point& pos) {
+void NotifyIcon::PopUpContextMenu(const gfx::Point& pos) {
// Returns if context menu isn't set.
if (!menu_model_)
return;
void DisplayBalloon(const gfx::Image& icon,
const base::string16& title,
const base::string16& contents) override;
- void PopContextMenu(const gfx::Point& pos) override;
+ void PopUpContextMenu(const gfx::Point& pos) override;
void SetContextMenu(ui::SimpleMenuModel* menu_model) override;
private:
Emitted when the tray icon is clicked.
-__Note:__ The `bounds` payload is only implemented on OS X and Windows 7 or newer.
+__Note:__ The `bounds` payload is only implemented on OS X and Windows.
### Event: 'right-clicked'
__Note:__ This is only implemented on Windows.
-### Tray.popContextMenu([position])
+### Tray.popUpContextMenu([position])
* `position` Object - The pop position
* `x` Integer