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 a7b96392e69893f6bdff24ec34715e912981ddf4..a476a7de2e5f85f53ae7c430ae82f4cb4ff975f7 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,7 +21,7 @@ class WindowEventTarget; |
} |
namespace content { |
-class RenderWidgetHostViewAura; |
+class LegacyRenderWidgetHostHWND; |
ananta
2014/09/23 20:14:05
Is this needed?
dmazzoni
2014/09/24 22:57:51
Good catch, not needed anymore. Done.
|
// Reasons for the existence of this class outlined below:- |
// 1. Some screen readers expect every tab / every unique web content container |
@@ -39,17 +40,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 { |
+ 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. |
+// that 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(); |
+ |
DECLARE_WND_CLASS_EX(L"Chrome_RenderWidgetHostHWND", CS_DBLCLKS, 0); |
typedef ATL::CWindowImpl<LegacyRenderWidgetHostHWND, |
@@ -59,10 +69,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 +93,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 +111,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 +138,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_ |
- |