Commit b3f90938 authored by msw@chromium.org's avatar msw@chromium.org

Only allow editable textfields to consume backspace.

Do not prevent accelerator handling by read only textfields.

BUG=374006
TEST=Backspace navigates back on when a popup omnibox or cookies dialog textfield is focused.
R=pkasting@chromium.org

Review URL: https://codereview.chromium.org/289183002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271232 0039d316-1c4b-4281-b951-d872f2087c98
parent 98989875
......@@ -724,9 +724,10 @@ bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) {
}
#endif
// Skip any accelerator handling of backspace; textfields handle this key.
// Skip backspace accelerator handling; editable textfields handle this key.
// Also skip processing Windows [Alt]+<num-pad digit> Unicode alt-codes.
return event.key_code() == ui::VKEY_BACK || event.IsUnicodeKeyCode();
const bool is_backspace = event.key_code() == ui::VKEY_BACK;
return (is_backspace && !read_only()) || event.IsUnicodeKeyCode();
}
bool Textfield::GetDropFormats(
......
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