diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 22:23:58 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 22:23:58 +0000 |
commit | f2e191bc8d9e9937a60ca1e4ec527c7aa0c6aaee (patch) | |
tree | 3f01f7725c4ee496a39ae2a2686a5911c16f3624 | |
parent | 92531b60bd6309768fad2998411cf9943fcd6d46 (diff) | |
download | chromium_src-f2e191bc8d9e9937a60ca1e4ec527c7aa0c6aaee.zip chromium_src-f2e191bc8d9e9937a60ca1e4ec527c7aa0c6aaee.tar.gz chromium_src-f2e191bc8d9e9937a60ca1e4ec527c7aa0c6aaee.tar.bz2 |
* Allow a user to select the last selected item when moving back to submenu.
* Ignore false mouseover when switching to submenu, which was closing submenu.
* Fixed a bug that was setting selection when moving a mouse. (in native_menu_domui.cc)
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3615010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61575 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/views/native_menu_domui.cc | 2 | ||||
-rw-r--r-- | chrome/browser/resources/menu.js | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/views/native_menu_domui.cc b/chrome/browser/chromeos/views/native_menu_domui.cc index 1cd68f1..42ca581 100644 --- a/chrome/browser/chromeos/views/native_menu_domui.cc +++ b/chrome/browser/chromeos/views/native_menu_domui.cc @@ -231,7 +231,7 @@ bool NativeMenuDOMUI::Dispatch(GdkEvent* event) { NativeMenuDOMUI* target = FindMenuAt( gfx::Point(event->motion.x_root, event->motion.y_root)); if (target) - target->menu_widget_->EnableInput(true); + target->menu_widget_->EnableInput(false); break; } case GDK_BUTTON_PRESS: { diff --git a/chrome/browser/resources/menu.js b/chrome/browser/resources/menu.js index f843e656..0dffad4 100644 --- a/chrome/browser/resources/menu.js +++ b/chrome/browser/resources/menu.js @@ -72,7 +72,8 @@ MenuItem.prototype = { activate: function() { if (this.attrs.type == 'submenu') { this.menu_.openSubmenu(this); - } else if (this.attrs.type != 'separator') { + } else if (this.attrs.type != 'separator' && + this.div.className.indexOf('selected') >= 0) { sendClick(this.id); } }, @@ -356,7 +357,10 @@ Menu.prototype = { onMouseover_: function(event, item) { this.cancelSubmenuTimer_(); - if (this.current_ != item && item.attrs.enabled) { + // Ignore false mouseover event at (0,0) which is + // emitted when opening submenu. + if (item.attrs.enabled && + (event.x != 0 && event.y != 0)) { item.select(); } }, @@ -364,7 +368,6 @@ Menu.prototype = { onMouseout_: function(event) { if (this.current_) { this.current_.unselect(); - this.current_ = null; } }, @@ -388,7 +391,6 @@ Menu.prototype = { if (!this.is_root) { if (this.current_) { this.current_.unselect(); - this.current_ = null; } chrome.send('move_to_parent', []); } |