diff --git a/atom/browser/api/atom_api_menu.h b/atom/browser/api/atom_api_menu.h index d345262810..1ea83653e7 100644 --- a/atom/browser/api/atom_api_menu.h +++ b/atom/browser/api/atom_api_menu.h @@ -52,8 +52,9 @@ class Menu : public mate::TrackableObject, void MenuWillShow(ui::SimpleMenuModel* source) override; virtual void Popup(Window* window) = 0; - virtual void PopupAt(Window* window, int x, int y, - int positioningItem = 0) = 0; + virtual void PopupAt(Window* window, + int x = -1, int y = -1, + int positioning_item = 0) = 0; scoped_ptr model_; Menu* parent_; diff --git a/atom/browser/api/atom_api_menu_mac.h b/atom/browser/api/atom_api_menu_mac.h index e71198315b..34450bc8b5 100644 --- a/atom/browser/api/atom_api_menu_mac.h +++ b/atom/browser/api/atom_api_menu_mac.h @@ -20,7 +20,7 @@ class MenuMac : public Menu { MenuMac(); void Popup(Window* window) override; - void PopupAt(Window* window, int x, int y, int positioningItem = 0) override; + void PopupAt(Window* window, int x, int y, int positioning_item = 0) override; base::scoped_nsobject menu_controller_; diff --git a/atom/browser/api/atom_api_menu_mac.mm b/atom/browser/api/atom_api_menu_mac.mm index 7e505ccd9d..d87617a5fc 100644 --- a/atom/browser/api/atom_api_menu_mac.mm +++ b/atom/browser/api/atom_api_menu_mac.mm @@ -50,7 +50,7 @@ void MenuMac::Popup(Window* window) { forView:web_contents->GetContentNativeView()]; } -void MenuMac::PopupAt(Window* window, int x, int y, int positioningItem) { +void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item) { NativeWindow* native_window = window->window(); if (!native_window) return; @@ -64,13 +64,13 @@ void MenuMac::PopupAt(Window* window, int x, int y, int positioningItem) { NSView* view = web_contents->GetContentNativeView(); // Show the menu. - if (positioningItem >= [menu numberOfItems]) { - positioningItem = [menu numberOfItems] - 1; + if (positioning_item >= [menu numberOfItems]) { + positioning_item = [menu numberOfItems] - 1; } - if (positioningItem < 0) { - positioningItem = 0; + if (positioning_item < 0) { + positioning_item = 0; } - [menu popUpMenuPositioningItem:[menu itemAtIndex:positioningItem] + [menu popUpMenupositioning_item:[menu itemAtIndex:positioning_item] atLocation:NSMakePoint(x, [view frame].size.height - y) inView:view]; } diff --git a/atom/browser/api/atom_api_menu_views.cc b/atom/browser/api/atom_api_menu_views.cc index 67b55d5e98..93869df87f 100644 --- a/atom/browser/api/atom_api_menu_views.cc +++ b/atom/browser/api/atom_api_menu_views.cc @@ -20,7 +20,7 @@ void MenuViews::Popup(Window* window) { PopupAtPoint(window, gfx::Screen::GetNativeScreen()->GetCursorScreenPoint()); } -void MenuViews::PopupAt(Window* window, int x, int y, int positioningItem) { +void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) { NativeWindow* native_window = static_cast(window->window()); if (!native_window) return; diff --git a/atom/browser/api/atom_api_menu_views.h b/atom/browser/api/atom_api_menu_views.h index 9e306b4e72..9f1b116a00 100644 --- a/atom/browser/api/atom_api_menu_views.h +++ b/atom/browser/api/atom_api_menu_views.h @@ -18,7 +18,7 @@ class MenuViews : public Menu { protected: void Popup(Window* window) override; - void PopupAt(Window* window, int x, int y, int positioningItem = 0) override; + void PopupAt(Window* window, int x, int y, int positioning_item = 0) override; private: void PopupAtPoint(Window* window, const gfx::Point& point);