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

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

Issue 1741093002: Fixes alternating keyboard and mouse hot-tracking in menus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes alternating keyboard and mouse hot-tracking in menus (comments) Created 4 years, 9 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 <stddef.h> 10 #include <stddef.h>
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 MenuItemView* ExitMenuRun(); 554 MenuItemView* ExitMenuRun();
555 555
556 // Handles the mouse location event on the submenu |source|. 556 // Handles the mouse location event on the submenu |source|.
557 void HandleMouseLocation(SubmenuView* source, 557 void HandleMouseLocation(SubmenuView* source,
558 const gfx::Point& mouse_location); 558 const gfx::Point& mouse_location);
559 559
560 // Sets hot-tracked state to the first focusable descendant view of |item|. 560 // Sets hot-tracked state to the first focusable descendant view of |item|.
561 void SetInitialHotTrackedView(MenuItemView* item, 561 void SetInitialHotTrackedView(MenuItemView* item,
562 SelectionIncrementDirectionType direction); 562 SelectionIncrementDirectionType direction);
563 563
564 // Updates the current |hot_button_| and its hot tracked state.
565 void SetHotTrackedButton(CustomButton* hot_button);
566
564 // The active instance. 567 // The active instance.
565 static MenuController* active_instance_; 568 static MenuController* active_instance_;
566 569
567 // If true, Run blocks. If false, Run doesn't block and this is used for 570 // If true, Run blocks. If false, Run doesn't block and this is used for
568 // drag and drop. Note that the semantics for drag and drop are slightly 571 // drag and drop. Note that the semantics for drag and drop are slightly
569 // different: cancel timer is kicked off any time the drag moves outside the 572 // different: cancel timer is kicked off any time the drag moves outside the
570 // menu, mouse events do nothing... 573 // menu, mouse events do nothing...
571 bool blocking_run_; 574 bool blocking_run_;
572 575
573 // If true, we're showing. 576 // If true, we're showing.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 // underway. 655 // underway.
653 scoped_ptr<MenuScrollTask> scroll_task_; 656 scoped_ptr<MenuScrollTask> scroll_task_;
654 657
655 // The lock to keep the menu button pressed while a menu is visible. 658 // The lock to keep the menu button pressed while a menu is visible.
656 scoped_ptr<MenuButton::PressedLock> pressed_lock_; 659 scoped_ptr<MenuButton::PressedLock> pressed_lock_;
657 660
658 // ViewStorage id used to store the view mouse drag events are forwarded to. 661 // ViewStorage id used to store the view mouse drag events are forwarded to.
659 // See UpdateActiveMouseView() for details. 662 // See UpdateActiveMouseView() for details.
660 const int active_mouse_view_id_; 663 const int active_mouse_view_id_;
661 664
665 // Current hot tracked child button if any.
666 CustomButton* hot_button_;
667
662 internal::MenuControllerDelegate* delegate_; 668 internal::MenuControllerDelegate* delegate_;
663 669
664 // How deep we are in nested message loops. This should be at most 2 (when 670 // How deep we are in nested message loops. This should be at most 2 (when
665 // showing a context menu from a menu). 671 // showing a context menu from a menu).
666 int message_loop_depth_; 672 int message_loop_depth_;
667 673
668 // The timestamp of the event which closed the menu - or 0 otherwise. 674 // The timestamp of the event which closed the menu - or 0 otherwise.
669 base::TimeDelta closing_event_time_; 675 base::TimeDelta closing_event_time_;
670 676
671 // Time when the menu is first shown. 677 // Time when the menu is first shown.
(...skipping 28 matching lines...) Expand all
700 #if defined(USE_AURA) 706 #if defined(USE_AURA)
701 scoped_ptr<MenuKeyEventHandler> key_event_handler_; 707 scoped_ptr<MenuKeyEventHandler> key_event_handler_;
702 #endif 708 #endif
703 709
704 DISALLOW_COPY_AND_ASSIGN(MenuController); 710 DISALLOW_COPY_AND_ASSIGN(MenuController);
705 }; 711 };
706 712
707 } // namespace views 713 } // namespace views
708 714
709 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 715 #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