summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authormhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 05:32:25 +0000
committermhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 05:32:25 +0000
commitb9376951e95e4cb1dda5a21f6f698a359ad51da0 (patch)
tree0f9e7fd4990cf431578bf15222ac2d5e4299d008 /views
parent6371bf471df4ae89446c22b924909f09ad034fae (diff)
downloadchromium_src-b9376951e95e4cb1dda5a21f6f698a359ad51da0.zip
chromium_src-b9376951e95e4cb1dda5a21f6f698a359ad51da0.tar.gz
chromium_src-b9376951e95e4cb1dda5a21f6f698a359ad51da0.tar.bz2
Implement keyboard access between bookmarks and main toolbar.
Allow ALT+SHIFT+T and TAB to traverse between bookmarks bar and main toolbar, same thing goes for SHIFT+TAB. Once any toolbar is focused, the arrow keys are used to traverse its children views. Any toolbar that needs to be traversable needs to extend "AccessibleToolbarView", that class will deal with all the toolbar accessibility needs such as handling ESC, Left/Right arrows, Enter, Drop downs, and traversals with Tab/Shift+Tab. There is one abstract method that the views who are extending this would need to implement if needed which allows the toolbar to skip views that are being traversed: bool IsAccessibleViewTraversable(views::View* view) BUG=25625 TEST=Test to see if the main toolbar and bookmarks bar is traversable. Review URL: http://codereview.chromium.org/333010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/button/menu_button.cc7
-rw-r--r--views/controls/button/menu_button.h8
2 files changed, 15 insertions, 0 deletions
diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc
index 7fb81cb..eb9d952 100644
--- a/views/controls/button/menu_button.cc
+++ b/views/controls/button/menu_button.cc
@@ -35,6 +35,9 @@ static const SkBitmap* kMenuMarker = NULL;
static const int kMenuMarkerPaddingLeft = 3;
static const int kMenuMarkerPaddingRight = -1;
+// static
+const char MenuButton::kViewClassName[] = "views/MenuButton";
+
////////////////////////////////////////////////////////////////////////////////
//
// MenuButton - constructors, destructors, initialization
@@ -252,4 +255,8 @@ bool MenuButton::GetAccessibleState(AccessibilityTypes::State* state) {
return true;
}
+std::string MenuButton::GetClassName() const {
+ return kViewClassName;
+}
+
} // namespace views
diff --git a/views/controls/button/menu_button.h b/views/controls/button/menu_button.h
index 1f5f8e8..44a93c6 100644
--- a/views/controls/button/menu_button.h
+++ b/views/controls/button/menu_button.h
@@ -5,6 +5,8 @@
#ifndef VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_
#define VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_
+#include <string>
+
#include "app/gfx/font.h"
#include "base/time.h"
#include "views/background.h"
@@ -25,6 +27,9 @@ class ViewMenuDelegate;
////////////////////////////////////////////////////////////////////////////////
class MenuButton : public TextButton {
public:
+ // The menu button's class name.
+ static const char kViewClassName[];
+
//
// Create a Button
MenuButton(ButtonListener* listener,
@@ -56,6 +61,9 @@ class MenuButton : public TextButton {
virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
virtual bool GetAccessibleState(AccessibilityTypes::State* state);
+ // Returns views/MenuButton.
+ virtual std::string GetClassName() const;
+
protected:
// True if the menu is currently visible.
bool menu_visible_;