| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcrack.h> | 9 #include <atlcrack.h> |
| 10 #include <atlwin.h> | 10 #include <atlwin.h> |
| 11 #include <oleacc.h> | 11 #include <oleacc.h> |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/win/scoped_comptr.h" | 16 #include "base/win/scoped_comptr.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
| 19 | 19 |
| 20 namespace gfx { | 20 namespace gfx { |
| 21 namespace win { | 21 namespace win { |
| 22 class DirectManipulationHelper; | 22 class DirectManipulationHelper; |
| 23 } // namespace win | 23 } // namespace win |
| 24 } // namespace gfx | 24 } // namespace gfx |
| 25 | 25 |
| 26 namespace ui { | 26 namespace ui { |
| 27 class AXFakeCaretWin; |
| 27 class WindowEventTarget; | 28 class WindowEventTarget; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace content { | 31 namespace content { |
| 31 class RenderWidgetHostViewAura; | 32 class RenderWidgetHostViewAura; |
| 32 | 33 |
| 33 // Reasons for the existence of this class outlined below:- | 34 // Reasons for the existence of this class outlined below:- |
| 34 // 1. Some screen readers expect every tab / every unique web content container | 35 // 1. Some screen readers expect every tab / every unique web content container |
| 35 // to be in its own HWND with class name Chrome_RenderWidgetHostHWND. | 36 // to be in its own HWND with class name Chrome_RenderWidgetHostHWND. |
| 36 // With Aura there is one main HWND which comprises the whole browser window | 37 // With Aura there is one main HWND which comprises the whole browser window |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 114 |
| 114 // Resizes the window to the bounds passed in. | 115 // Resizes the window to the bounds passed in. |
| 115 void SetBounds(const gfx::Rect& bounds); | 116 void SetBounds(const gfx::Rect& bounds); |
| 116 | 117 |
| 117 // The pointer to the containing RenderWidgetHostViewAura instance is passed | 118 // The pointer to the containing RenderWidgetHostViewAura instance is passed |
| 118 // here. | 119 // here. |
| 119 void set_host(RenderWidgetHostViewAura* host) { | 120 void set_host(RenderWidgetHostViewAura* host) { |
| 120 host_ = host; | 121 host_ = host; |
| 121 } | 122 } |
| 122 | 123 |
| 124 // Changes the position of the fake caret. |
| 125 void MoveCaretTo(const gfx::Rect& bounds); |
| 126 |
| 123 protected: | 127 protected: |
| 124 void OnFinalMessage(HWND hwnd) override; | 128 void OnFinalMessage(HWND hwnd) override; |
| 125 | 129 |
| 126 private: | 130 private: |
| 127 explicit LegacyRenderWidgetHostHWND(HWND parent); | 131 explicit LegacyRenderWidgetHostHWND(HWND parent); |
| 128 ~LegacyRenderWidgetHostHWND() override; | 132 ~LegacyRenderWidgetHostHWND() override; |
| 129 | 133 |
| 130 bool Init(); | 134 bool Init(); |
| 131 | 135 |
| 132 // Returns the target to which the windows input events are forwarded. | 136 // Returns the target to which the windows input events are forwarded. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 152 LRESULT OnSize(UINT message, WPARAM w_param, LPARAM l_param); | 156 LRESULT OnSize(UINT message, WPARAM w_param, LPARAM l_param); |
| 153 LRESULT OnWindowPosChanged(UINT message, WPARAM w_param, LPARAM l_param); | 157 LRESULT OnWindowPosChanged(UINT message, WPARAM w_param, LPARAM l_param); |
| 154 | 158 |
| 155 base::win::ScopedComPtr<IAccessible> window_accessible_; | 159 base::win::ScopedComPtr<IAccessible> window_accessible_; |
| 156 | 160 |
| 157 // Set to true if we turned on mouse tracking. | 161 // Set to true if we turned on mouse tracking. |
| 158 bool mouse_tracking_enabled_; | 162 bool mouse_tracking_enabled_; |
| 159 | 163 |
| 160 RenderWidgetHostViewAura* host_; | 164 RenderWidgetHostViewAura* host_; |
| 161 | 165 |
| 166 // Some assistive software need to track the location of the caret. |
| 167 std::unique_ptr<ui::AXFakeCaretWin> ax_fake_caret_; |
| 168 |
| 162 // This class provides functionality to register the legacy window as a | 169 // This class provides functionality to register the legacy window as a |
| 163 // Direct Manipulation consumer. This allows us to support smooth scroll | 170 // Direct Manipulation consumer. This allows us to support smooth scroll |
| 164 // in Chrome on Windows 10. | 171 // in Chrome on Windows 10. |
| 165 std::unique_ptr<gfx::win::DirectManipulationHelper> | 172 std::unique_ptr<gfx::win::DirectManipulationHelper> |
| 166 direct_manipulation_helper_; | 173 direct_manipulation_helper_; |
| 167 | 174 |
| 168 DISALLOW_COPY_AND_ASSIGN(LegacyRenderWidgetHostHWND); | 175 DISALLOW_COPY_AND_ASSIGN(LegacyRenderWidgetHostHWND); |
| 169 }; | 176 }; |
| 170 | 177 |
| 171 } // namespace content | 178 } // namespace content |
| 172 | 179 |
| 173 #endif // CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ | 180 #endif // CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ |
| 174 | 181 |
| OLD | NEW |