diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-04 00:10:21 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-04 00:10:21 +0000 |
commit | 4be5aac332f8cd47b660f8b7b5d8e275d9388d78 (patch) | |
tree | 4dd78c6cc89c9d224e02daba3d0ad48a66e80ce3 /ui/views | |
parent | 5ed2b64d966ced91f2e74c44ba0c4346bc73cfde (diff) | |
download | chromium_src-4be5aac332f8cd47b660f8b7b5d8e275d9388d78.zip chromium_src-4be5aac332f8cd47b660f8b7b5d8e275d9388d78.tar.gz chromium_src-4be5aac332f8cd47b660f8b7b5d8e275d9388d78.tar.bz2 |
Limit alt-codes to Windows; fix Linux Aura Alt+Left/Right.
Linux doesn't support the EF_EXTENDED KeyEvent flag like Windows.
So IsUnicodeKeyCode has a false-positive for [Left|Right]Arrow.
That breaks the [Alt]+[Left|Right]Arrow accelerators for Back/Forward.
(when the Omnibox or another non-content browser textfield has focus)
Limit KeyEvent::IsUnicodeKeyCode functionality to Windows.
Alt-codes (as [Alt]+<num-pad digit>) are not handled on Linux anyway:
http://en.wikipedia.org/wiki/Alt_code#Linux
Cleanup Textfield comment and USE_AURA preprocessor directive blocks.
BUG=339632
TEST=Linux Aura handles the [Alt]+[Left|Right]Arrow Back/Forward accelerators when the Omnibox or Find Bar is focused. No [Alt]+<num-pad digit> Unicode alt-code regressions on Windows.
R=sadrul@chromium.org
Review URL: https://codereview.chromium.org/179923008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/controls/textfield/textfield.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index 826d042..94888d7 100644 --- a/ui/views/controls/textfield/textfield.cc +++ b/ui/views/controls/textfield/textfield.cc @@ -10,6 +10,7 @@ #include "grit/ui_strings.h" #include "ui/accessibility/ax_view_state.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" +#include "ui/base/cursor/cursor.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/drag_utils.h" #include "ui/base/resource/resource_bundle.h" @@ -32,11 +33,7 @@ #include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" -#if defined(USE_AURA) -#include "ui/base/cursor/cursor.h" -#endif - -#if defined(OS_WIN) && defined(USE_AURA) +#if defined(OS_WIN) #include "base/win/win_util.h" #endif @@ -321,7 +318,7 @@ void Textfield::AboutToRequestFocusFromTabTraversal(bool reverse) { bool Textfield::SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) { // Skip any accelerator handling of backspace; textfields handle this key. - // Also skip processing of [Alt]+<num-pad digit> Unicode alt key codes. + // Also skip processing Windows [Alt]+<num-pad digit> Unicode alt-codes. return e.key_code() == ui::VKEY_BACK || e.IsUnicodeKeyCode(); } @@ -633,13 +630,7 @@ gfx::NativeCursor Textfield::GetCursor(const ui::MouseEvent& event) { bool in_selection = GetRenderText()->IsPointInSelection(event.location()); bool drag_event = event.type() == ui::ET_MOUSE_DRAGGED; bool text_cursor = !initiating_drag_ && (drag_event || !in_selection); -#if defined(USE_AURA) return text_cursor ? ui::kCursorIBeam : ui::kCursorNull; -#elif defined(OS_WIN) - static HCURSOR ibeam = LoadCursor(NULL, IDC_IBEAM); - static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW); - return text_cursor ? ibeam : arrow; -#endif } void Textfield::OnGestureEvent(ui::GestureEvent* event) { |