diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 22:40:40 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 22:40:40 +0000 |
commit | 74c4423e17424e3259b1335d2cbc58aeffa529d9 (patch) | |
tree | 77a573fba936e06341f1d2caf9088ef6683015c4 /views/controls/menu/menu_controller.h | |
parent | 080936cc27b0743e01e4759acfe51e02e022b3c7 (diff) | |
download | chromium_src-74c4423e17424e3259b1335d2cbc58aeffa529d9.zip chromium_src-74c4423e17424e3259b1335d2cbc58aeffa529d9.tar.gz chromium_src-74c4423e17424e3259b1335d2cbc58aeffa529d9.tar.bz2 |
Adds some debugging in code in hopes of figuring out a crash in the
menu code. It seems like we end up getting mouse events from a widget
that is no longer visible. Additionally it seems possible that the
selection is cleared before we expect it. Hopefully both of these
CHECKs will help figure out what is going on.
BUG=62872
TEST=none
Review URL: http://codereview.chromium.org/6288002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/menu_controller.h')
-rw-r--r-- | views/controls/menu/menu_controller.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/views/controls/menu/menu_controller.h b/views/controls/menu/menu_controller.h index 0ccd4a5..b28cad7 100644 --- a/views/controls/menu/menu_controller.h +++ b/views/controls/menu/menu_controller.h @@ -77,18 +77,6 @@ class MenuController : public MessageLoopForUI::Dispatcher { // Whether or not drag operation is in progress. bool drag_in_progress() const { return drag_in_progress_; } - // Sets the selection to menu_item, a value of NULL unselects everything. - // If open_submenu is true and menu_item has a submenu, the submenu is shown. - // If update_immediately is true, submenus are opened immediately, otherwise - // submenus are only opened after a timer fires. - // - // Internally this updates pending_state_ immediatley, and if - // update_immediately is true, CommitPendingSelection is invoked to - // show/hide submenus and update state_. - void SetSelection(MenuItemView* menu_item, - bool open_submenu, - bool update_immediately); - // Cancels the current Run. See ExitType for a description of what happens // with the various parameters. void Cancel(ExitType type); @@ -125,6 +113,22 @@ class MenuController : public MessageLoopForUI::Dispatcher { struct SelectByCharDetails; + // Values supplied to SetSelection. + enum SetSelectionTypes { + SELECTION_DEFAULT = 0, + + // If set submenus are opened immediately, otherwise submenus are only + // openned after a timer fires. + SELECTION_UPDATE_IMMEDIATELY = 1 << 0, + + // If set and the menu_item has a submenu, the submenu is shown. + SELECTION_OPEN_SUBMENU = 1 << 1, + + // SetSelection is being invoked as the result exiting or cancelling the + // menu. This is used for debugging. + SELECTION_EXIT = 1 << 2, + }; + // Tracks selection information. struct State { State() : item(NULL), submenu_open(false) {} @@ -183,6 +187,15 @@ class MenuController : public MessageLoopForUI::Dispatcher { SubmenuView* submenu; }; + // Sets the selection to menu_item a value of NULL unselects + // everything. |types| is a bitmask of |SetSelectionTypes|. + // + // Internally this updates pending_state_ immediatley. state_ is only updated + // immediately if SELECTION_UPDATE_IMMEDIATELY is set. If + // SELECTION_UPDATE_IMMEDIATELY is not set CommitPendingSelection is invoked + // to show/hide submenus and update state_. + void SetSelection(MenuItemView* menu_item, int types); + // Sets the active MenuController. static void SetActiveInstance(MenuController* controller); |