summaryrefslogtreecommitdiffstats
path: root/views/focus
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 15:16:10 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 15:16:10 +0000
commit22b887aed04e9b9d13cb856abe1f57da08f348d7 (patch)
treeae38d8e4beb0656970375a4f6b789fc973e61eb7 /views/focus
parent0da7636f1e91b05a407a310800d6fe79796931a4 (diff)
downloadchromium_src-22b887aed04e9b9d13cb856abe1f57da08f348d7.zip
chromium_src-22b887aed04e9b9d13cb856abe1f57da08f348d7.tar.gz
chromium_src-22b887aed04e9b9d13cb856abe1f57da08f348d7.tar.bz2
Revert 42465 - Keyboard accessibility for the page and app menus.
Reverting because newly added Test*MenuKeyboardAccess tests fail on some of the Windows buildbots, and possibly a XP Perf regression. Works on Windows, and on Linux with toolkit_views. The goal is to make Chrome behave more like a standard Windows application, for users who rely on the keyboard and expect standard keyboard accelerators to work. Pressing F10, or pressing and releasing Alt, will set focus to the Page menu, as if it was the first item in a menu bar. Pressing enter, space, up arrow, or down arrow will open the focused menu. Once a menu is opened, pressing left and right arrows will switch between the two menus. Pressing escape will return focus to the title of the previously open menu. A new UI test attempts to select something from the menus using only the keyboard. It works on Linux (with toolkit_views) and on Windows. BUG=none TEST=New keyboard accessibility ui test. Review URL: http://codereview.chromium.org/660323 TBR=dmazzoni@chromium.org Review URL: http://codereview.chromium.org/1257003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r--views/focus/accelerator_handler_gtk.cc19
-rw-r--r--views/focus/focus_manager.h4
-rw-r--r--views/focus/focus_manager_gtk.cc6
-rw-r--r--views/focus/focus_manager_win.cc7
4 files changed, 1 insertions, 35 deletions
diff --git a/views/focus/accelerator_handler_gtk.cc b/views/focus/accelerator_handler_gtk.cc
index da7bd94..1ff5d81 100644
--- a/views/focus/accelerator_handler_gtk.cc
+++ b/views/focus/accelerator_handler_gtk.cc
@@ -4,9 +4,6 @@
#include <gtk/gtk.h>
-#include "base/keyboard_code_conversion_gtk.h"
-#include "base/keyboard_codes.h"
-#include "views/accelerator.h"
#include "views/focus/accelerator_handler.h"
#include "views/focus/focus_manager.h"
#include "views/widget/widget_gtk.h"
@@ -51,14 +48,6 @@ bool AcceleratorHandler::Dispatch(GdkEvent* event) {
if (event->type == GDK_KEY_PRESS) {
KeyEvent view_key_event(key_event);
-
- // If it's the Alt key, don't send it to the focus manager until release
- // (to handle focusing the menu bar).
- if (view_key_event.GetKeyCode() == base::VKEY_MENU) {
- last_key_pressed_ = key_event->keyval;
- return true;
- }
-
// FocusManager::OnKeyPressed and OnKeyReleased return false if this
// message has been consumed and should not be propagated further.
if (!focus_manager->OnKeyEvent(view_key_event)) {
@@ -71,14 +60,6 @@ bool AcceleratorHandler::Dispatch(GdkEvent* event) {
// as accelerators to avoid unpaired key release.
if (event->type == GDK_KEY_RELEASE &&
key_event->keyval == last_key_pressed_) {
- // Special case: the Alt key can trigger an accelerator on release
- // rather than on press.
- if (base::WindowsKeyCodeForGdkKeyCode(key_event->keyval) ==
- base::VKEY_MENU) {
- Accelerator accelerator(base::VKEY_MENU, false, false, false);
- focus_manager->ProcessAccelerator(accelerator);
- }
-
last_key_pressed_ = 0;
return true;
}
diff --git a/views/focus/focus_manager.h b/views/focus/focus_manager.h
index 2150560..bad9dba 100644
--- a/views/focus/focus_manager.h
+++ b/views/focus/focus_manager.h
@@ -278,10 +278,6 @@ class FocusManager {
static FocusManager* GetFocusManagerForNativeView(
gfx::NativeView native_view);
- // Retrieves the FocusManager associated with the passed native view.
- static FocusManager* GetFocusManagerForNativeWindow(
- gfx::NativeWindow native_window);
-
private:
// Returns the next focusable view.
View* GetNextFocusableView(View* starting_view, bool reverse, bool dont_loop);
diff --git a/views/focus/focus_manager_gtk.cc b/views/focus/focus_manager_gtk.cc
index a52a6d9..3038d93 100644
--- a/views/focus/focus_manager_gtk.cc
+++ b/views/focus/focus_manager_gtk.cc
@@ -49,10 +49,4 @@ FocusManager* FocusManager::GetFocusManagerForNativeView(
return focus_manager;
}
-// static
-FocusManager* FocusManager::GetFocusManagerForNativeWindow(
- gfx::NativeWindow native_window) {
- return GetFocusManagerForNativeView(GTK_WIDGET(native_window));
-}
-
} // namespace views
diff --git a/views/focus/focus_manager_win.cc b/views/focus/focus_manager_win.cc
index faf3815..fbccf7b 100644
--- a/views/focus/focus_manager_win.cc
+++ b/views/focus/focus_manager_win.cc
@@ -27,10 +27,5 @@ FocusManager* FocusManager::GetFocusManagerForNativeView(
return widget ? widget->GetFocusManager() : NULL;
}
-// static
-FocusManager* FocusManager::GetFocusManagerForNativeWindow(
- gfx::NativeWindow native_window) {
- return GetFocusManagerForNativeView(native_window);
-}
-
} // namespace views
+