| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // when blocking. This schedules the loop to quit. | 284 // when blocking. This schedules the loop to quit. |
| 285 void Accept(MenuItemView* item, int event_flags); | 285 void Accept(MenuItemView* item, int event_flags); |
| 286 | 286 |
| 287 bool ShowSiblingMenu(SubmenuView* source, const gfx::Point& mouse_location); | 287 bool ShowSiblingMenu(SubmenuView* source, const gfx::Point& mouse_location); |
| 288 | 288 |
| 289 // Shows a context menu for |menu_item| as a result of a located event if | 289 // Shows a context menu for |menu_item| as a result of a located event if |
| 290 // appropriate. This is invoked on long press and releasing the right mouse | 290 // appropriate. This is invoked on long press and releasing the right mouse |
| 291 // button. Returns whether a context menu was shown. | 291 // button. Returns whether a context menu was shown. |
| 292 bool ShowContextMenu(MenuItemView* menu_item, | 292 bool ShowContextMenu(MenuItemView* menu_item, |
| 293 SubmenuView* source, | 293 SubmenuView* source, |
| 294 const ui::LocatedEvent& event); | 294 const ui::LocatedEvent& event, |
| 295 ui::MenuSourceType source_type); |
| 295 | 296 |
| 296 // Closes all menus, including any menus of nested invocations of Run. | 297 // Closes all menus, including any menus of nested invocations of Run. |
| 297 void CloseAllNestedMenus(); | 298 void CloseAllNestedMenus(); |
| 298 | 299 |
| 299 // Gets the enabled menu item at the specified location. | 300 // Gets the enabled menu item at the specified location. |
| 300 // If over_any_menu is non-null it is set to indicate whether the location | 301 // If over_any_menu is non-null it is set to indicate whether the location |
| 301 // is over any menu. It is possible for this to return NULL, but | 302 // is over any menu. It is possible for this to return NULL, but |
| 302 // over_any_menu to be true. For example, the user clicked on a separator. | 303 // over_any_menu to be true. For example, the user clicked on a separator. |
| 303 MenuItemView* GetMenuItemAt(View* menu, int x, int y); | 304 MenuItemView* GetMenuItemAt(View* menu, int x, int y); |
| 304 | 305 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 573 |
| 573 // Time when the menu is first shown. | 574 // Time when the menu is first shown. |
| 574 base::TimeTicks menu_start_time_; | 575 base::TimeTicks menu_start_time_; |
| 575 | 576 |
| 576 DISALLOW_COPY_AND_ASSIGN(MenuController); | 577 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 577 }; | 578 }; |
| 578 | 579 |
| 579 } // namespace views | 580 } // namespace views |
| 580 | 581 |
| 581 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 582 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |