| 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; | |
| 28 class WindowEventTarget; | 27 class WindowEventTarget; |
| 29 } | 28 } |
| 30 | 29 |
| 31 namespace content { | 30 namespace content { |
| 32 class RenderWidgetHostViewAura; | 31 class RenderWidgetHostViewAura; |
| 33 | 32 |
| 34 // Reasons for the existence of this class outlined below:- | 33 // Reasons for the existence of this class outlined below:- |
| 35 // 1. Some screen readers expect every tab / every unique web content container | 34 // 1. Some screen readers expect every tab / every unique web content container |
| 36 // to be in its own HWND with class name Chrome_RenderWidgetHostHWND. | 35 // to be in its own HWND with class name Chrome_RenderWidgetHostHWND. |
| 37 // With Aura there is one main HWND which comprises the whole browser window | 36 // 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... |
| 114 | 113 |
| 115 // Resizes the window to the bounds passed in. | 114 // Resizes the window to the bounds passed in. |
| 116 void SetBounds(const gfx::Rect& bounds); | 115 void SetBounds(const gfx::Rect& bounds); |
| 117 | 116 |
| 118 // The pointer to the containing RenderWidgetHostViewAura instance is passed | 117 // The pointer to the containing RenderWidgetHostViewAura instance is passed |
| 119 // here. | 118 // here. |
| 120 void set_host(RenderWidgetHostViewAura* host) { | 119 void set_host(RenderWidgetHostViewAura* host) { |
| 121 host_ = host; | 120 host_ = host; |
| 122 } | 121 } |
| 123 | 122 |
| 124 // Changes the position of the fake caret. | |
| 125 void MoveCaretTo(const gfx::Rect& bounds); | |
| 126 | |
| 127 protected: | 123 protected: |
| 128 void OnFinalMessage(HWND hwnd) override; | 124 void OnFinalMessage(HWND hwnd) override; |
| 129 | 125 |
| 130 private: | 126 private: |
| 131 explicit LegacyRenderWidgetHostHWND(HWND parent); | 127 explicit LegacyRenderWidgetHostHWND(HWND parent); |
| 132 ~LegacyRenderWidgetHostHWND() override; | 128 ~LegacyRenderWidgetHostHWND() override; |
| 133 | 129 |
| 134 bool Init(); | 130 bool Init(); |
| 135 | 131 |
| 136 // Returns the target to which the windows input events are forwarded. | 132 // Returns the target to which the windows input events are forwarded. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 156 LRESULT OnSize(UINT message, WPARAM w_param, LPARAM l_param); | 152 LRESULT OnSize(UINT message, WPARAM w_param, LPARAM l_param); |
| 157 LRESULT OnWindowPosChanged(UINT message, WPARAM w_param, LPARAM l_param); | 153 LRESULT OnWindowPosChanged(UINT message, WPARAM w_param, LPARAM l_param); |
| 158 | 154 |
| 159 base::win::ScopedComPtr<IAccessible> window_accessible_; | 155 base::win::ScopedComPtr<IAccessible> window_accessible_; |
| 160 | 156 |
| 161 // Set to true if we turned on mouse tracking. | 157 // Set to true if we turned on mouse tracking. |
| 162 bool mouse_tracking_enabled_; | 158 bool mouse_tracking_enabled_; |
| 163 | 159 |
| 164 RenderWidgetHostViewAura* host_; | 160 RenderWidgetHostViewAura* host_; |
| 165 | 161 |
| 166 // Some assistive software need to track the location of the caret. | |
| 167 std::unique_ptr<ui::AXFakeCaretWin> ax_fake_caret_; | |
| 168 | |
| 169 // This class provides functionality to register the legacy window as a | 162 // This class provides functionality to register the legacy window as a |
| 170 // Direct Manipulation consumer. This allows us to support smooth scroll | 163 // Direct Manipulation consumer. This allows us to support smooth scroll |
| 171 // in Chrome on Windows 10. | 164 // in Chrome on Windows 10. |
| 172 std::unique_ptr<gfx::win::DirectManipulationHelper> | 165 std::unique_ptr<gfx::win::DirectManipulationHelper> |
| 173 direct_manipulation_helper_; | 166 direct_manipulation_helper_; |
| 174 | 167 |
| 175 DISALLOW_COPY_AND_ASSIGN(LegacyRenderWidgetHostHWND); | 168 DISALLOW_COPY_AND_ASSIGN(LegacyRenderWidgetHostHWND); |
| 176 }; | 169 }; |
| 177 | 170 |
| 178 } // namespace content | 171 } // namespace content |
| 179 | 172 |
| 180 #endif // CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ | 173 #endif // CONTENT_BROWSER_RENDERER_HOST_LEGACY_RENDER_WIDGET_HOST_WIN_H_ |
| 181 | 174 |
| OLD | NEW |