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

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

Issue 1775533002: Fixes incorrect clearing of hot-tracked state when context menu is opened from a menu item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moves hot_button tracking from MenuController to MenuController::State (unit test) 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 // Tracks selection information. 237 // Tracks selection information.
238 struct State { 238 struct State {
239 State(); 239 State();
240 State(const State& other); 240 State(const State& other);
241 ~State(); 241 ~State();
242 242
243 // The selected menu item. 243 // The selected menu item.
244 MenuItemView* item; 244 MenuItemView* item;
245 245
246 // Used to capture a hot tracked child button when a nested menu is opened
247 // and to restore the hot tracked state when exiting a nested menu.
248 CustomButton* hot_button;
249
246 // If item has a submenu this indicates if the submenu is showing. 250 // If item has a submenu this indicates if the submenu is showing.
247 bool submenu_open; 251 bool submenu_open;
248 252
249 // Bounds passed to the run menu. Used for positioning the first menu. 253 // Bounds passed to the run menu. Used for positioning the first menu.
250 gfx::Rect initial_bounds; 254 gfx::Rect initial_bounds;
251 255
252 // Position of the initial menu. 256 // Position of the initial menu.
253 MenuAnchorPosition anchor; 257 MenuAnchorPosition anchor;
254 258
255 // The direction child menus have opened in. 259 // The direction child menus have opened in.
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 // The timestamp of the event which closed the menu - or 0 otherwise. 675 // The timestamp of the event which closed the menu - or 0 otherwise.
672 base::TimeDelta closing_event_time_; 676 base::TimeDelta closing_event_time_;
673 677
674 // Time when the menu is first shown. 678 // Time when the menu is first shown.
675 base::TimeTicks menu_start_time_; 679 base::TimeTicks menu_start_time_;
676 680
677 // If a mouse press triggered this menu, this will have its location (in 681 // If a mouse press triggered this menu, this will have its location (in
678 // screen coordinates). Otherwise this will be (0, 0). 682 // screen coordinates). Otherwise this will be (0, 0).
679 gfx::Point menu_start_mouse_press_loc_; 683 gfx::Point menu_start_mouse_press_loc_;
680 684
681 // Controls behviour differences between an asynchronous run, and other types 685 // Controls behaviour differences between an asynchronous run, and other types
682 // of run (blocking, drag and drop). 686 // of run (blocking, drag and drop).
683 bool async_run_; 687 bool async_run_;
684 688
685 // Controls behavior differences between a combobox and other types of menu 689 // Controls behavior differences between a combobox and other types of menu
686 // (like a context menu). 690 // (like a context menu).
687 bool is_combobox_; 691 bool is_combobox_;
688 692
689 // Set to true if the menu item was selected by touch. 693 // Set to true if the menu item was selected by touch.
690 bool item_selected_by_touch_; 694 bool item_selected_by_touch_;
691 695
(...skipping 11 matching lines...) Expand all
703 #if defined(USE_AURA) 707 #if defined(USE_AURA)
704 scoped_ptr<MenuKeyEventHandler> key_event_handler_; 708 scoped_ptr<MenuKeyEventHandler> key_event_handler_;
705 #endif 709 #endif
706 710
707 DISALLOW_COPY_AND_ASSIGN(MenuController); 711 DISALLOW_COPY_AND_ASSIGN(MenuController);
708 }; 712 };
709 713
710 } // namespace views 714 } // namespace views
711 715
712 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 716 #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