Index: content/browser/renderer_host/legacy_render_widget_host_win.h |
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.h b/content/browser/renderer_host/legacy_render_widget_host_win.h |
index a78de28a7bbc291941efd5d9ded3b0058782b374..8db9d642bc6a0a6a3dbf52dacd95677f8d435bce 100644 |
--- a/content/browser/renderer_host/legacy_render_widget_host_win.h |
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.h |
@@ -13,6 +13,7 @@ |
#include "base/basictypes.h" |
#include "base/win/scoped_comptr.h" |
#include "content/common/content_export.h" |
+#include "ui/gfx/native_widget_types.h" |
#include "ui/gfx/rect.h" |
namespace ui { |
@@ -20,8 +21,6 @@ class WindowEventTarget; |
} |
namespace content { |
-class RenderWidgetHostViewAura; |
- |
// Reasons for the existence of this class outlined below:- |
// 1. Some screen readers expect every tab / every unique web content container |
// to be in its own HWND with class name Chrome_RenderWidgetHostHWND. |
@@ -39,17 +38,26 @@ class RenderWidgetHostViewAura; |
// fail. |
// We should look to get rid of this code when all of the above are fixed. |
+// A delegate interface for LegacyRenderWidgetHostHWND to query the |
+// native view accessible from the owner class. |
+class CONTENT_EXPORT LegacyRenderWidgetHostHWNDDelegate { |
sky
2014/10/27 15:21:33
nit: move into it's own file.
dmazzoni
2014/10/27 20:32:32
Done.
|
+ public: |
+ // Get the native view accessible for the web contents. |
+ // Once initialized, this should always return a valid object, but the |
+ // object may change as the user navigates. |
+ virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0; |
+}; |
+ |
// This class implements a child HWND with the same size as the content area, |
-// that delegates its accessibility implementation to the root of the |
-// BrowserAccessibilityManager tree. This HWND is hooked up as the parent of |
-// the root object in the BrowserAccessibilityManager tree, so when any |
-// accessibility client calls ::WindowFromAccessibleObject, they get this |
-// HWND instead of the DesktopWindowTreeHostWin. |
+// and delegates its accessibility implementation to the |
+// gfx::NativeViewAccessible provided by the owner class. |
class CONTENT_EXPORT LegacyRenderWidgetHostHWND |
: public ATL::CWindowImpl<LegacyRenderWidgetHostHWND, |
NON_EXPORTED_BASE(ATL::CWindow), |
ATL::CWinTraits<WS_CHILD> > { |
public: |
+ virtual ~LegacyRenderWidgetHostHWND(); |
sky
2014/10/27 15:21:33
Move implementation to match new position.
dmazzoni
2014/10/27 20:32:32
Done. I moved it immediately after Create in both
sky
2014/10/27 22:04:54
That's not entirely true. From the style guide for
|
+ |
DECLARE_WND_CLASS_EX(L"Chrome_RenderWidgetHostHWND", CS_DBLCLKS, 0); |
typedef ATL::CWindowImpl<LegacyRenderWidgetHostHWND, |
@@ -59,10 +67,9 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND |
// Creates and returns an instance of the LegacyRenderWidgetHostHWND class on |
// successful creation of a child window parented to the parent window passed |
// in. |
- static LegacyRenderWidgetHostHWND* Create(HWND parent); |
- |
- // Destroys the HWND managed by this class. |
- void Destroy(); |
+ static LegacyRenderWidgetHostHWND* Create( |
+ HWND parent, |
+ LegacyRenderWidgetHostHWNDDelegate* delegate); |
BEGIN_MSG_MAP_EX(LegacyRenderWidgetHostHWND) |
MESSAGE_HANDLER_EX(WM_GETOBJECT, OnGetObject) |
@@ -84,6 +91,8 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND |
MESSAGE_HANDLER_EX(WM_SIZE, OnSize) |
END_MSG_MAP() |
+ // May be deleted at any time by Windows! Other classes should never store |
+ // this value. |
HWND hwnd() { return m_hWnd; } |
// Called when the child window is to be reparented to a new window. |
@@ -100,18 +109,9 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND |
// Resizes the window to the bounds passed in. |
void SetBounds(const gfx::Rect& bounds); |
- // The pointer to the containing RenderWidgetHostViewAura instance is passed |
- // here. |
- void set_host(RenderWidgetHostViewAura* host) { |
- host_ = host; |
- } |
- |
- protected: |
- virtual void OnFinalMessage(HWND hwnd) override; |
- |
private: |
- LegacyRenderWidgetHostHWND(HWND parent); |
- ~LegacyRenderWidgetHostHWND(); |
+ LegacyRenderWidgetHostHWND(HWND parent, |
+ LegacyRenderWidgetHostHWNDDelegate* delegate); |
bool Init(); |
@@ -136,17 +136,16 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND |
LRESULT OnNCCalcSize(UINT message, WPARAM w_param, LPARAM l_param); |
LRESULT OnSize(UINT message, WPARAM w_param, LPARAM l_param); |
+ LegacyRenderWidgetHostHWNDDelegate* delegate_; |
+ |
base::win::ScopedComPtr<IAccessible> window_accessible_; |
// Set to true if we turned on mouse tracking. |
bool mouse_tracking_enabled_; |
- RenderWidgetHostViewAura* host_; |
- |
DISALLOW_COPY_AND_ASSIGN(LegacyRenderWidgetHostHWND); |
}; |
} // namespace content |
#endif // CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ |
- |