summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-17 02:20:19 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-17 02:20:19 +0000
commit4189b0de2312dc216ce2938a88b794c1987fe2eb (patch)
treeb094a5e79486f3123f5c3e3b76233f187690290a /ui
parentc80851c79569a5a5435606cb921891d5a26dcfa3 (diff)
downloadchromium_src-4189b0de2312dc216ce2938a88b794c1987fe2eb.zip
chromium_src-4189b0de2312dc216ce2938a88b794c1987fe2eb.tar.gz
chromium_src-4189b0de2312dc216ce2938a88b794c1987fe2eb.tar.bz2
Enable mnemonic and bookmark folder key activation on menu
BUG=107869 TEST=manually tested on wrench menu and folder. Review URL: http://codereview.chromium.org/8984001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/controls/menu/menu_controller.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 4188a77..b0c80de 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -892,10 +892,16 @@ base::MessagePumpDispatcher::DispatchStatus
if (!OnKeyDown(ui::KeyboardCodeFromNative(xev)))
return base::MessagePumpDispatcher::EVENT_QUIT;
- // TODO(oshima): support SelectChar.
- // See http://crbug.com/107869.
+ // OnKeyDown may have set exit_type_.
+ // TODO(sky): This shouldn't be necessary if OnKeyDown returns correct
+ // value for space key on edit menu. Fix OnKeyDown and remove this.
+ // See crbug.com/107919.
+ if (exit_type_ != EXIT_NONE)
+ return base::MessagePumpDispatcher::EVENT_QUIT;
- return base::MessagePumpDispatcher::EVENT_PROCESSED;
+ return SelectByChar(ui::KeyboardCodeFromNative(xev)) ?
+ base::MessagePumpDispatcher::EVENT_QUIT :
+ base::MessagePumpDispatcher::EVENT_PROCESSED;
case ui::ET_KEY_RELEASED:
return base::MessagePumpDispatcher::EVENT_PROCESSED;
default:
@@ -924,6 +930,7 @@ bool MenuController::Dispatch(GdkEvent* event) {
return false;
// OnKeyDown may have set exit_type_.
+ // TODO(sky): Eliminate this. See crbug.com/107919.
if (exit_type_ != EXIT_NONE)
return false;