positioningItem => positioning_item
This commit is contained in:
parent
ea9b0cfed0
commit
360266ba5b
5 changed files with 12 additions and 11 deletions
|
@ -52,8 +52,9 @@ class Menu : public mate::TrackableObject<Menu>,
|
|||
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<AtomMenuModel> model_;
|
||||
Menu* parent_;
|
||||
|
|
|
@ -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<AtomMenuController> menu_controller_;
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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<NativeWindow*>(window->window());
|
||||
if (!native_window)
|
||||
return;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue