summaryrefslogtreecommitdiffstats
path: root/views/view.cc
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 06:56:33 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 06:56:33 +0000
commit79e549faf26611d5ac05bc4f7fefd4a71a23fcb2 (patch)
treee7c50ebe8d193233ce2b06bbf5751bb9e82115b7 /views/view.cc
parent36096983abafe5aa7a1df56904db3c0c8fa9ee2e (diff)
downloadchromium_src-79e549faf26611d5ac05bc4f7fefd4a71a23fcb2.zip
chromium_src-79e549faf26611d5ac05bc4f7fefd4a71a23fcb2.tar.gz
chromium_src-79e549faf26611d5ac05bc4f7fefd4a71a23fcb2.tar.bz2
Re-land: Refactor Views accessibility.
BUG=74988 TEST=none Review URL: http://codereview.chromium.org/6581010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view.cc')
-rw-r--r--views/view.cc49
1 files changed, 6 insertions, 43 deletions
diff --git a/views/view.cc b/views/view.cc
index aede253..7a706992 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -11,6 +11,7 @@
#include "base/scoped_ptr.h"
#include "base/utf_string_conversions.h"
#include "third_party/skia/include/core/SkRect.h"
+#include "ui/base/accessibility/accessibility_types.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/path.h"
@@ -26,7 +27,7 @@
#if defined(OS_WIN)
#include "base/win/scoped_gdi_object.h"
-#include "views/accessibility/view_accessibility.h"
+#include "views/accessibility/native_view_accessibility_win.h"
#endif
#if defined(OS_LINUX)
#include "ui/base/gtk/scoped_handle_gtk.h"
@@ -95,8 +96,8 @@ View::~View() {
}
#if defined(OS_WIN)
- if (view_accessibility_.get())
- view_accessibility_->set_view(NULL);
+ if (native_view_accessibility_win_.get())
+ native_view_accessibility_win_->set_view(NULL);
#endif
}
@@ -1009,45 +1010,6 @@ bool View::ExceededDragThreshold(int delta_x, int delta_y) {
abs(delta_y) > GetVerticalDragThreshold());
}
-// Accessibility ---------------------------------------------------------------
-
-void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type) {
- NotifyAccessibilityEvent(event_type, true);
-}
-
-string16 View::GetAccessibleDefaultAction() {
- return string16();
-}
-
-string16 View::GetAccessibleKeyboardShortcut() {
- return string16();
-}
-
-bool View::GetAccessibleName(string16* name) {
- DCHECK(name);
-
- if (accessible_name_.empty())
- return false;
- *name = accessible_name_;
- return true;
-}
-
-AccessibilityTypes::Role View::GetAccessibleRole() {
- return AccessibilityTypes::ROLE_CLIENT;
-}
-
-AccessibilityTypes::State View::GetAccessibleState() {
- return 0;
-}
-
-string16 View::GetAccessibleValue() {
- return string16();
-}
-
-void View::SetAccessibleName(const string16& name) {
- accessible_name_ = name;
-}
-
// Scrolling -------------------------------------------------------------------
void View::ScrollRectToVisible(const gfx::Rect& rect) {
@@ -1179,7 +1141,8 @@ void View::OnFocus() {
// TODO(beng): Investigate whether it's possible for us to move this to
// Focus().
// Notify assistive technologies of the focus change.
- NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS);
+ GetWidget()->NotifyAccessibilityEvent(
+ this, ui::AccessibilityTypes::EVENT_FOCUS, true);
}
void View::OnBlur() {