diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 15:16:10 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 15:16:10 +0000 |
commit | 22b887aed04e9b9d13cb856abe1f57da08f348d7 (patch) | |
tree | ae38d8e4beb0656970375a4f6b789fc973e61eb7 /chrome/browser/views/toolbar_view.h | |
parent | 0da7636f1e91b05a407a310800d6fe79796931a4 (diff) | |
download | chromium_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 'chrome/browser/views/toolbar_view.h')
-rw-r--r-- | chrome/browser/views/toolbar_view.h | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h index 675eb33..23f5232 100644 --- a/chrome/browser/views/toolbar_view.h +++ b/chrome/browser/views/toolbar_view.h @@ -20,7 +20,6 @@ #include "chrome/browser/views/location_bar_view.h" #include "views/controls/button/menu_button.h" #include "views/controls/menu/menu.h" -#include "views/controls/menu/menu_wrapper.h" #include "views/controls/menu/view_menu_delegate.h" #include "views/view.h" @@ -37,7 +36,6 @@ class Menu2; class ToolbarView : public AccessibleToolbarView, public views::ViewMenuDelegate, public views::DragController, - public views::FocusChangeListener, public menus::SimpleMenuModel::Delegate, public LocationBarView::Delegate, public NotificationObserver, @@ -46,7 +44,7 @@ class ToolbarView : public AccessibleToolbarView, public BubblePositioner { public: explicit ToolbarView(Browser* browser); - virtual ~ToolbarView(); + virtual ~ToolbarView() { } // Create the contents of the Browser Toolbar void Init(Profile* profile); @@ -64,25 +62,6 @@ class ToolbarView : public AccessibleToolbarView, // Sets the app menu model. void SetAppMenuModel(AppMenuModel* model); - // Focuses the page menu and enters a special mode where the page - // and app menus are focusable and allow for keyboard navigation just - // like a normal menu bar. As soon as focus leaves one of the menus, - // the special mode is exited. - // - // Pass it the storage id of the view where focus should be returned - // if the user escapes, and the menu button to focus initially. If - // |menu_to_focus| is NULL, it will focus the page menu by default. - // - // Not used on the Mac, which has a "normal" menu bar. - void EnterMenuBarEmulationMode(int last_focused_view_storage_id, - views::MenuButton* menu_to_focus); - - // Add a listener to receive a callback when the menu opens. - void AddMenuListener(views::MenuListener* listener); - - // Remove a menu listener. - void RemoveMenuListener(views::MenuListener* listener); - // Accessors... Browser* browser() const { return browser_; } BrowserActionsContainer* browser_actions() const { return browser_actions_; } @@ -92,10 +71,6 @@ class ToolbarView : public AccessibleToolbarView, views::MenuButton* page_menu() const { return page_menu_; } views::MenuButton* app_menu() const { return app_menu_; } - // Overridden from views::FocusChangeListener: - virtual void FocusWillChange(views::View* focused_before, - views::View* focused_now); - // Overridden from AccessibleToolbarView: virtual bool IsAccessibleViewTraversable(views::View* view); @@ -131,7 +106,6 @@ class ToolbarView : public AccessibleToolbarView, virtual void ExecuteCommand(int command_id); // Overridden from views::View: - virtual bool AcceleratorPressed(const views::Accelerator& accelerator); virtual gfx::Size GetPreferredSize(); virtual void Layout(); virtual void Paint(gfx::Canvas* canvas); @@ -164,13 +138,6 @@ class ToolbarView : public AccessibleToolbarView, void RunPageMenu(const gfx::Point& pt); void RunAppMenu(const gfx::Point& pt); - // Check if the menu exited with a code indicating the user wants to - // switch to the other menu, and then switch to that other menu. - void SwitchToOtherMenuIfNeeded(views::Menu2* previous_menu, - views::MenuButton* next_menu_button); - - void ActivateMenuButton(views::MenuButton* menu_button); - // Types of display mode this toolbar can have. enum DisplayMode { DISPLAYMODE_NORMAL, // Normal toolbar with buttons, etc. @@ -181,14 +148,6 @@ class ToolbarView : public AccessibleToolbarView, return display_mode_ == DISPLAYMODE_NORMAL; } - // Take the menus out of the focus traversal, unregister accelerators, - // and stop listening to focus change events. - void ExitMenuBarEmulationMode(); - - // Restore the view that was focused before EnterMenuBarEmulationMode - // was called. - void RestoreLastFocusedView(); - scoped_ptr<BackForwardMenuModel> back_menu_model_; scoped_ptr<BackForwardMenuModel> forward_menu_model_; @@ -227,16 +186,6 @@ class ToolbarView : public AccessibleToolbarView, // TODO(beng): build these into MenuButton. scoped_ptr<views::Menu2> page_menu_menu_; scoped_ptr<views::Menu2> app_menu_menu_; - - // Storage id for the last view that was focused before focus - // was given to one of the toolbar views. - int last_focused_view_storage_id_; - - // Vector of listeners to receive callbacks when the menu opens. - std::vector<views::MenuListener*> menu_listeners_; - - // Used to post tasks to switch to the next/previous menu. - ScopedRunnableMethodFactory<ToolbarView> method_factory_; }; #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |