Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: ui/views/controls/menu/menu_controller.h

Issue 1230163004: Selects last item in a menu when pressing 'up' initially (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Selects last item in a menu when pressing 'up' initially (comments) Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 438 // Returns the first (|delta| == 1) or the last (|delta| == -1) selectable
439 // selectable menu items NULL is returned. 439 // child menu item of |parent|. If there are no selectable items returns NULL.
440 MenuItemView* FindFirstSelectableMenuItem(MenuItemView* parent); 440 MenuItemView* FindInitialSelectableMenuItem(MenuItemView* parent, int delta);
441 441
442 // 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|
443 // and incrementing index by |delta|. If there are no more selectable menu 443 // and incrementing index by |delta|. If there are no more selectable menu
444 // items NULL is returned. 444 // items NULL is returned.
445 MenuItemView* FindNextSelectableMenuItem(MenuItemView* parent, 445 MenuItemView* FindNextSelectableMenuItem(MenuItemView* parent,
446 int index, 446 int index,
447 int delta); 447 int delta);
448 448
449 // 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
450 // the selection is changed such that the menu opens immediately. 450 // the selection is changed such that the menu opens immediately.
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 bool item_selected_by_touch_; 640 bool item_selected_by_touch_;
641 641
642 scoped_ptr<MenuMessageLoop> message_loop_; 642 scoped_ptr<MenuMessageLoop> message_loop_;
643 643
644 DISALLOW_COPY_AND_ASSIGN(MenuController); 644 DISALLOW_COPY_AND_ASSIGN(MenuController);
645 }; 645 };
646 646
647 } // namespace views 647 } // namespace views
648 648
649 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 649 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | ui/views/controls/menu/menu_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698