| Index: content/browser/renderer_host/legacy_render_widget_host_win.cc
|
| diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
| index 42aa43cec26fe634d972b9a1bd7a59d2a6f4b1bd..107ca0a8610ef0b2e8c32ed0429f1721493b9c70 100644
|
| --- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
| +++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
|
| @@ -15,6 +15,7 @@
|
| #include "content/browser/renderer_host/render_widget_host_impl.h"
|
| #include "content/browser/renderer_host/render_widget_host_view_aura.h"
|
| #include "content/public/common/content_switches.h"
|
| +#include "ui/accessibility/platform/ax_fake_caret_win.h"
|
| #include "ui/base/view_prop.h"
|
| #include "ui/base/win/internal_constants.h"
|
| #include "ui/base/win/window_event_target.h"
|
| @@ -170,24 +171,39 @@ LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message,
|
| return static_cast<LRESULT>(0L);
|
| }
|
|
|
| - if (static_cast<DWORD>(OBJID_CLIENT) != obj_id || !host_)
|
| + if (!host_)
|
| return static_cast<LRESULT>(0L);
|
|
|
| - RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(
|
| - host_->GetRenderWidgetHost());
|
| - if (!rwhi)
|
| - return static_cast<LRESULT>(0L);
|
| + if (static_cast<DWORD>(OBJID_CLIENT) == obj_id) {
|
| + RenderWidgetHostImpl* rwhi =
|
| + RenderWidgetHostImpl::From(host_->GetRenderWidgetHost());
|
| + if (!rwhi)
|
| + return static_cast<LRESULT>(0L);
|
| +
|
| + BrowserAccessibilityManagerWin* manager =
|
| + static_cast<BrowserAccessibilityManagerWin*>(
|
| + rwhi->GetRootBrowserAccessibilityManager());
|
| + if (!manager)
|
| + return static_cast<LRESULT>(0L);
|
| +
|
| + base::win::ScopedComPtr<IAccessible> root(
|
| + ToBrowserAccessibilityWin(manager->GetRoot()));
|
| + return LresultFromObject(IID_IAccessible, w_param,
|
| + static_cast<IAccessible*>(root.Detach()));
|
| + }
|
|
|
| - BrowserAccessibilityManagerWin* manager =
|
| - static_cast<BrowserAccessibilityManagerWin*>(
|
| - rwhi->GetRootBrowserAccessibilityManager());
|
| - if (!manager)
|
| - return static_cast<LRESULT>(0L);
|
| + if (static_cast<DWORD>(OBJID_CARET) == obj_id && host_->HasFocus()) {
|
| + // Used by some assistive software to retrieve the location of the caret.
|
| + ui::AXFakeCaretWin* fake_caret = ui::g_ax_fake_caret_win.Pointer();
|
| + DCHECK(fake_caret);
|
| + base::win::ScopedComPtr<IAccessible> fake_caret_accessible =
|
| + fake_caret->GetCaret();
|
| + ;
|
| + return LresultFromObject(IID_IAccessible, w_param,
|
| + fake_caret_accessible.Detach());
|
| + }
|
|
|
| - base::win::ScopedComPtr<IAccessible> root(
|
| - ToBrowserAccessibilityWin(manager->GetRoot()));
|
| - return LresultFromObject(IID_IAccessible, w_param,
|
| - static_cast<IAccessible*>(root.Detach()));
|
| + return static_cast<LRESULT>(0L);
|
| }
|
|
|
| // We send keyboard/mouse/touch messages to the parent window via SendMessage.
|
|
|