Commit 101b8786 authored by sschmitz@chromium.org's avatar sschmitz@chromium.org

Reverting fix for crbug.com/138309 which caused this problem (Filed bug...

Reverting fix for crbug.com/138309 which caused this problem (Filed bug crbug.com/168910 to re-fix 138309 differently).

The fix for crbug.com/138309 dismisses context menus on ChromeOS when Ctrl or Alt is pressed.
This prevents context menus that allow for Ctrl clicks to work (because they are closed prematurely).

The problem that the fix for 138309 tried to address is that "tab navigation" short-cuts work but leave
context menus up. These types of shortcuts should either be blocked or dismiss the context menu.

For more info see:
crbug.com/167539 (this bug)
crbug.com/139308 (bug fix being reverted)
crbug.com/168910 (replica of 139308)

BUG=167539
TEST=manual:
Create bookmark folder with entries
Click on bookmark folder 
Control Click on an entry

Review URL: https://chromiumcodereview.appspot.com/11826012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175715 0039d316-1c4b-4281-b951-d872f2087c98
parent 1a4cb9dc
......@@ -941,33 +941,12 @@ bool MenuController::Dispatch(const base::NativeEvent& event) {
aura::Env::GetInstance()->GetDispatcher()->Dispatch(event);
return false;
}
// We exit the menu and its message loop on control and alt keypress.
// So that accelerators such as control-n don't run with a nested
// message loop we exit on any modifier that might be used for an
// accelerator.
// If the user presses control-n, the menu disappears already when
// the control key is down. When "n" (while control is still down)
// is pressed the shortcut is handled normally after the nested loop
// has ended and the context menu has disappeared.
// We don't exit the menu on the release of modifiers as the menu
// may have been shown by way of an accelerator, eg alt-f. So that
// if we exited menus on the release of modifiers the menu would
// first appear and then immediately disappear.
const ui::EventType event_type = ui::EventTypeFromNative(event);
if (event_type == ui::ET_KEY_PRESSED ) {
const ui::KeyboardCode key_code = ui::KeyboardCodeFromNative(event);
if (key_code == ui::VKEY_LCONTROL || key_code == ui::VKEY_CONTROL ||
key_code == ui::VKEY_RCONTROL || key_code == ui::VKEY_MENU ) {
Cancel(EXIT_ALL);
return false;
}
}
// Activates mnemonics only when it it pressed without modifiers except for
// caps and shift.
int flags = ui::EventFlagsFromNative(event) &
~ui::EF_CAPS_LOCK_DOWN & ~ui::EF_SHIFT_DOWN;
if (flags == ui::EF_NONE) {
switch (event_type) {
switch (ui::EventTypeFromNative(event)) {
case ui::ET_KEY_PRESSED:
if (!OnKeyDown(ui::KeyboardCodeFromNative(event)))
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment