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

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

Issue 1661673004: Enables hot-tracking for overflow extension buttons in the app menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restores hot-tracking of extension buttons in app menu with MD Created 4 years, 10 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 void ExitAsyncRun(); 560 void ExitAsyncRun();
561 561
562 // Performs the teardown of the menu launched by Run(). The selected item is 562 // Performs the teardown of the menu launched by Run(). The selected item is
563 // returned. 563 // returned.
564 MenuItemView* ExitMenuRun(); 564 MenuItemView* ExitMenuRun();
565 565
566 // Handles the mouse location event on the submenu |source|. 566 // Handles the mouse location event on the submenu |source|.
567 void HandleMouseLocation(SubmenuView* source, 567 void HandleMouseLocation(SubmenuView* source,
568 const gfx::Point& mouse_location); 568 const gfx::Point& mouse_location);
569 569
570 // Updates the current |hot_button_| and its hot tracked state.
571 void SetHotTrackedButton(CustomButton* hot_button, bool is_hot_tracked);
572
573 // Sets hot-tracked state to the first focusable descendant view of |item|.
574 void SetInitialHotTrackedView(MenuItemView* item,
575 SelectionIncrementDirectionType direction);
576
570 // The active instance. 577 // The active instance.
571 static MenuController* active_instance_; 578 static MenuController* active_instance_;
572 579
573 // If true, Run blocks. If false, Run doesn't block and this is used for 580 // If true, Run blocks. If false, Run doesn't block and this is used for
574 // drag and drop. Note that the semantics for drag and drop are slightly 581 // drag and drop. Note that the semantics for drag and drop are slightly
575 // different: cancel timer is kicked off any time the drag moves outside the 582 // different: cancel timer is kicked off any time the drag moves outside the
576 // menu, mouse events do nothing... 583 // menu, mouse events do nothing...
577 bool blocking_run_; 584 bool blocking_run_;
578 585
579 // If true, we're showing. 586 // If true, we're showing.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 // underway. 665 // underway.
659 scoped_ptr<MenuScrollTask> scroll_task_; 666 scoped_ptr<MenuScrollTask> scroll_task_;
660 667
661 // The lock to keep the menu button pressed while a menu is visible. 668 // The lock to keep the menu button pressed while a menu is visible.
662 scoped_ptr<MenuButton::PressedLock> pressed_lock_; 669 scoped_ptr<MenuButton::PressedLock> pressed_lock_;
663 670
664 // ViewStorage id used to store the view mouse drag events are forwarded to. 671 // ViewStorage id used to store the view mouse drag events are forwarded to.
665 // See UpdateActiveMouseView() for details. 672 // See UpdateActiveMouseView() for details.
666 const int active_mouse_view_id_; 673 const int active_mouse_view_id_;
667 674
675 // Current hot tracked view if any.
676 CustomButton* hot_button_;
677
668 internal::MenuControllerDelegate* delegate_; 678 internal::MenuControllerDelegate* delegate_;
669 679
670 // How deep we are in nested message loops. This should be at most 2 (when 680 // How deep we are in nested message loops. This should be at most 2 (when
671 // showing a context menu from a menu). 681 // showing a context menu from a menu).
672 int message_loop_depth_; 682 int message_loop_depth_;
673 683
674 // The timestamp of the event which closed the menu - or 0 otherwise. 684 // The timestamp of the event which closed the menu - or 0 otherwise.
675 base::TimeDelta closing_event_time_; 685 base::TimeDelta closing_event_time_;
676 686
677 // Time when the menu is first shown. 687 // Time when the menu is first shown.
(...skipping 28 matching lines...) Expand all
706 #if defined(USE_AURA) 716 #if defined(USE_AURA)
707 scoped_ptr<MenuKeyEventHandler> key_event_handler_; 717 scoped_ptr<MenuKeyEventHandler> key_event_handler_;
708 #endif 718 #endif
709 719
710 DISALLOW_COPY_AND_ASSIGN(MenuController); 720 DISALLOW_COPY_AND_ASSIGN(MenuController);
711 }; 721 };
712 722
713 } // namespace views 723 } // namespace views
714 724
715 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 725 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698