summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authormhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:58:18 +0000
committermhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:58:18 +0000
commit8de9751320f20f82198ca2d5a3d5ddbe066cbe87 (patch)
tree8582152732573755530231a5ab7f465f69f53031 /views
parente657bfcfb7f9f0f92c496cf28631d87d1a022a1c (diff)
downloadchromium_src-8de9751320f20f82198ca2d5a3d5ddbe066cbe87.zip
chromium_src-8de9751320f20f82198ca2d5a3d5ddbe066cbe87.tar.gz
chromium_src-8de9751320f20f82198ca2d5a3d5ddbe066cbe87.tar.bz2
Allow Extensions to have MSAA information.
The whole extension shelf and its items were missing MSAA information. Some of them were uninitialized due to the custom components not having any AccessibleRole. Some extensions have no name, this could happen where the user didn't put a name for their browser action in the manifest. If such case happens, we will use the extension name itself. BUG=36289 TEST=Extension shelf now has MSAA information according to Inspect32. Screenshot available on the issue tracker. Review URL: http://codereview.chromium.org/1105008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42289 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/resize_gripper.cc21
-rw-r--r--views/controls/resize_gripper.h6
2 files changed, 26 insertions, 1 deletions
diff --git a/views/controls/resize_gripper.cc b/views/controls/resize_gripper.cc
index 59a93ab..b4fd55f 100644
--- a/views/controls/resize_gripper.cc
+++ b/views/controls/resize_gripper.cc
@@ -4,8 +4,8 @@
#include "views/controls/resize_gripper.h"
-#include "base/logging.h"
#include "app/resource_bundle.h"
+#include "base/logging.h"
#include "grit/app_resources.h"
namespace views {
@@ -76,6 +76,25 @@ void ResizeGripper::OnMouseReleased(const views::MouseEvent& event,
ReportResizeAmount(event.x(), true);
}
+bool ResizeGripper::GetAccessibleRole(AccessibilityTypes::Role* role) {
+ DCHECK(role);
+ *role = AccessibilityTypes::ROLE_SEPARATOR;
+ return true;
+}
+
+bool ResizeGripper::GetAccessibleName(std::wstring* name) {
+ DCHECK(name);
+ if (!accessible_name_.empty()) {
+ *name = accessible_name_;
+ return true;
+ }
+ return false;
+}
+
+void ResizeGripper::SetAccessibleName(const std::wstring& name) {
+ accessible_name_.assign(name);
+}
+
void ResizeGripper::ReportResizeAmount(int resize_amount, bool last_update) {
gfx::Point point(resize_amount, 0);
View::ConvertPointToScreen(this, &point);
diff --git a/views/controls/resize_gripper.h b/views/controls/resize_gripper.h
index 588b01d..8586a22 100644
--- a/views/controls/resize_gripper.h
+++ b/views/controls/resize_gripper.h
@@ -44,6 +44,9 @@ class ResizeGripper : public ImageView {
virtual bool OnMousePressed(const views::MouseEvent& event);
virtual bool OnMouseDragged(const views::MouseEvent& event);
virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled);
+ virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
+ virtual bool GetAccessibleName(std::wstring* name);
+ virtual void SetAccessibleName(const std::wstring& name);
static const char kViewClassName[];
@@ -58,6 +61,9 @@ class ResizeGripper : public ImageView {
// The mouse position at start (in screen coordinates).
int initial_position_;
+ // The storage string for the accessibility name associated with this control.
+ std::wstring accessible_name_;
+
DISALLOW_COPY_AND_ASSIGN(ResizeGripper);
};