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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 gfx::Rect CalculateBubbleMenuBounds(MenuItemView* item, | 428 gfx::Rect CalculateBubbleMenuBounds(MenuItemView* item, |
429 bool prefer_leading, | 429 bool prefer_leading, |
430 bool* is_leading); | 430 bool* is_leading); |
431 | 431 |
432 // Returns the depth of the menu. | 432 // Returns the depth of the menu. |
433 static int MenuDepth(MenuItemView* item); | 433 static int MenuDepth(MenuItemView* item); |
434 | 434 |
435 // Selects the next/previous menu item. | 435 // Selects the next/previous menu item. |
436 void IncrementSelection(int delta); | 436 void IncrementSelection(int delta); |
437 | 437 |
| 438 // Returns the first selectable child menu item of |parent|. If there are no |
| 439 // selectable menu items NULL is returned. |
| 440 MenuItemView* FindFirstSelectableMenuItem(MenuItemView* parent); |
| 441 |
438 // Returns the next selectable child menu item of |parent| starting at |index| | 442 // Returns the next selectable child menu item of |parent| starting at |index| |
439 // and incrementing index by |delta|. If there are no more selected menu items | 443 // and incrementing index by |delta|. If there are no more selectable menu |
440 // NULL is returned. | 444 // items NULL is returned. |
441 MenuItemView* FindNextSelectableMenuItem(MenuItemView* parent, | 445 MenuItemView* FindNextSelectableMenuItem(MenuItemView* parent, |
442 int index, | 446 int index, |
443 int delta); | 447 int delta); |
444 | 448 |
445 // If the selected item has a submenu and it isn't currently open, the | 449 // If the selected item has a submenu and it isn't currently open, the |
446 // the selection is changed such that the menu opens immediately. | 450 // the selection is changed such that the menu opens immediately. |
447 void OpenSubmenuChangeSelectionIfCan(); | 451 void OpenSubmenuChangeSelectionIfCan(); |
448 | 452 |
449 // If possible, closes the submenu. | 453 // If possible, closes the submenu. |
450 void CloseSubmenu(); | 454 void CloseSubmenu(); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 bool item_selected_by_touch_; | 640 bool item_selected_by_touch_; |
637 | 641 |
638 scoped_ptr<MenuMessageLoop> message_loop_; | 642 scoped_ptr<MenuMessageLoop> message_loop_; |
639 | 643 |
640 DISALLOW_COPY_AND_ASSIGN(MenuController); | 644 DISALLOW_COPY_AND_ASSIGN(MenuController); |
641 }; | 645 }; |
642 | 646 |
643 } // namespace views | 647 } // namespace views |
644 | 648 |
645 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 649 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |