Commit ca6969ee authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Commit Bot

Enables AccessibleObjectFromEvent to retrieve the system caret

Each AXPlatformNodeWin, including the accessibility system caret, is assigned a unique ID on construction. Mistakenly, I was assigning a new ID instead of using the existing one when constructing the AXSystemCaretWin object which meant that all events were sent having the wrong object ID.
R=dmazzoni@chromium.org, aleventhal@chromium.org

Bug: 789176
Change-Id: I15681365ad0e461cf29789df9a4f69301e3e6104
Reviewed-on: https://chromium-review.googlesource.com/803858Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521109}
parent 0a240225
......@@ -18,7 +18,10 @@ namespace ui {
AXSystemCaretWin::AXSystemCaretWin(gfx::AcceleratedWidget event_target)
: event_target_(event_target) {
caret_ = static_cast<AXPlatformNodeWin*>(AXPlatformNodeWin::Create(this));
data_.id = GetNextAXPlatformNodeUniqueId();
// The caret object is not part of the accessibility tree and so doesn't need
// a node ID. A globally unique ID is used when firing Win events, retrieved
// via |unique_id|.
data_.id = -1;
data_.role = AX_ROLE_CARET;
// |get_accState| should return 0 which means that the caret is visible.
data_.state = 0;
......@@ -28,7 +31,7 @@ AXSystemCaretWin::AXSystemCaretWin(gfx::AcceleratedWidget event_target)
if (event_target_) {
::NotifyWinEvent(EVENT_OBJECT_CREATE, event_target_, OBJID_CARET,
-data_.id);
-caret_->unique_id());
}
}
......@@ -38,7 +41,7 @@ AXSystemCaretWin::~AXSystemCaretWin() {
// retrieve the destroyed object in this stack frame.
if (event_target_) {
::NotifyWinEvent(EVENT_OBJECT_DESTROY, event_target_, OBJID_CARET,
-data_.id);
-caret_->unique_id());
}
}
......@@ -57,7 +60,7 @@ void AXSystemCaretWin::MoveCaretTo(const gfx::Rect& bounds) {
data_.location = gfx::RectF(bounds);
if (event_target_) {
::NotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, event_target_, OBJID_CARET,
-data_.id);
-caret_->unique_id());
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment