diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 17:41:47 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 17:41:47 +0000 |
commit | 532bcef5cd9733771e2076b22e1267bc2721eccb (patch) | |
tree | 90fe49543236e40bc9c1dd5cb114700d01a0ad93 /chrome/browser/views/frame | |
parent | 532ecbb769085fa7000b9013dc831c71644e116a (diff) | |
download | chromium_src-532bcef5cd9733771e2076b22e1267bc2721eccb.zip chromium_src-532bcef5cd9733771e2076b22e1267bc2721eccb.tar.gz chromium_src-532bcef5cd9733771e2076b22e1267bc2721eccb.tar.bz2 |
Reverting this CL to fix the interactive ui test failures.
Revert 42498 - Keyboard accessibility for the page and app menus.
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 interactive ui test.
Review URL: http://codereview.chromium.org/660323
TBR=dmazzoni@chromium.org
Review URL: http://codereview.chromium.org/1428001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 34 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 4 |
2 files changed, 10 insertions, 28 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 1144b13..9d62c70 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -638,10 +638,10 @@ void BrowserView::TraverseNextAccessibleToolbar(bool forward) { // TODO(mohamed) This needs to be smart, that applies to all toolbars. // Currently it just traverses between bookmarks and toolbar. if (!forward && toolbar_->IsVisible() && toolbar_->IsEnabled()) { - toolbar_->RequestFocus(); + toolbar_->InitiateTraversal(last_focused_view_storage_id_); } else if (forward && bookmark_bar_view_->IsVisible() && bookmark_bar_view_->IsEnabled()) { - bookmark_bar_view_->RequestFocus(); + bookmark_bar_view_->InitiateTraversal(last_focused_view_storage_id_); } } @@ -850,31 +850,17 @@ void BrowserView::UpdateToolbar(TabContents* contents, } void BrowserView::FocusToolbar() { - // Start the traversal within the main toolbar, passing it the storage id - // of the view where focus should be returned if the user exits the toolbar. - SaveFocusedView(); - toolbar_->InitiateTraversal(last_focused_view_storage_id_); -} - -void BrowserView::FocusPageAndAppMenus() { - // Chrome doesn't have a traditional menu bar, but it has menu buttons in - // the main toolbar that play the same role. If the user presses a key - // that would typically focus the menu bar, tell the toolbar to focus - // the first menu button. Pass it the storage id of the view where - // focus should be returned if the user presses escape. - // - // Not used on the Mac, which has a normal menu bar. - SaveFocusedView(); - toolbar_->EnterMenuBarEmulationMode(last_focused_view_storage_id_, NULL); -} - -void BrowserView::SaveFocusedView() { + // Remove existing views in the storage, traversal should be restarted. views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); if (view_storage->RetrieveView(last_focused_view_storage_id_)) view_storage->RemoveView(last_focused_view_storage_id_); - views::View* focused_view = GetRootView()->GetFocusedView(); - if (focused_view) - view_storage->StoreView(last_focused_view_storage_id_, focused_view); + + // Store the last focused view into the storage, to handle existing traversal. + view_storage->StoreView(last_focused_view_storage_id_, + GetRootView()->GetFocusedView()); + + // Start the traversal within the main toolbar. + toolbar_->InitiateTraversal(last_focused_view_storage_id_); } void BrowserView::DestroyBrowser() { diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index fb020a0..8846787 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -270,7 +270,6 @@ class BrowserView : public BrowserBubbleHost, virtual void UpdateStopGoState(bool is_loading, bool force); virtual void UpdateToolbar(TabContents* contents, bool should_restore_state); virtual void FocusToolbar(); - virtual void FocusPageAndAppMenus(); virtual void DestroyBrowser(); virtual bool IsBookmarkBarVisible() const; virtual bool IsBookmarkBarAnimating() const; @@ -473,9 +472,6 @@ class BrowserView : public BrowserBubbleHost, // Initialize the hung plugin detector. void InitHangMonitor(); - // Save the current focused view to view storage - void SaveFocusedView(); - // Initialize class statics. static void InitClass(); |