| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 namespace gfx { | 31 namespace gfx { |
| 32 class Point; | 32 class Point; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace ui { | 35 namespace ui { |
| 36 class LatencyInfo; | 36 class LatencyInfo; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace content { | 39 namespace content { |
| 40 | 40 |
| 41 class RenderWidgetHostImpl; |
| 41 class RenderWidgetHostViewBase; | 42 class RenderWidgetHostViewBase; |
| 42 | 43 |
| 43 // Class owned by WebContentsImpl for the purpose of directing input events | 44 // Class owned by WebContentsImpl for the purpose of directing input events |
| 44 // to the correct RenderWidgetHost on pages with multiple RenderWidgetHosts. | 45 // to the correct RenderWidgetHost on pages with multiple RenderWidgetHosts. |
| 45 // It maintains a mapping of RenderWidgetHostViews to Surface IDs that they | 46 // It maintains a mapping of RenderWidgetHostViews to Surface IDs that they |
| 46 // own. When an input event requires routing based on window coordinates, | 47 // own. When an input event requires routing based on window coordinates, |
| 47 // this class requests a Surface hit test from the provided |root_view| and | 48 // this class requests a Surface hit test from the provided |root_view| and |
| 48 // forwards the event to the owning RWHV of the returned Surface ID. | 49 // forwards the event to the owning RWHV of the returned Surface ID. |
| 49 class CONTENT_EXPORT RenderWidgetHostInputEventRouter | 50 class CONTENT_EXPORT RenderWidgetHostInputEventRouter |
| 50 : public RenderWidgetHostViewBaseObserver { | 51 : public RenderWidgetHostViewBaseObserver { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 72 | 73 |
| 73 void AddSurfaceClientIdOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 74 void AddSurfaceClientIdOwner(uint32_t id, RenderWidgetHostViewBase* owner); |
| 74 void RemoveSurfaceClientIdOwner(uint32_t id); | 75 void RemoveSurfaceClientIdOwner(uint32_t id); |
| 75 | 76 |
| 76 bool is_registered(uint32_t id) { | 77 bool is_registered(uint32_t id) { |
| 77 return owner_map_.find(id) != owner_map_.end(); | 78 return owner_map_.find(id) != owner_map_.end(); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void OnHittestData(const FrameHostMsg_HittestData_Params& params); | 81 void OnHittestData(const FrameHostMsg_HittestData_Params& params); |
| 81 | 82 |
| 83 // Returns the RenderWidgetHostImpl inside the |root_view| at |point| where |
| 84 // |point| is with respect to |root_view|'s coordinates. If a RWHI is found, |
| 85 // the value of |transformed_point| is the coordinate of the point with |
| 86 // respect to the RWHI's coordinates. |
| 87 RenderWidgetHostImpl* GetRenderWidgetHostAtPoint( |
| 88 RenderWidgetHostViewBase* root_view, |
| 89 const gfx::Point& point, |
| 90 gfx::Point* transformed_point); |
| 91 |
| 82 private: | 92 private: |
| 83 struct HittestData { | 93 struct HittestData { |
| 84 bool ignored_for_hittest; | 94 bool ignored_for_hittest; |
| 85 }; | 95 }; |
| 86 | 96 |
| 87 class HittestDelegate : public cc::SurfaceHittestDelegate { | 97 class HittestDelegate : public cc::SurfaceHittestDelegate { |
| 88 public: | 98 public: |
| 89 HittestDelegate( | 99 HittestDelegate( |
| 90 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 100 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 91 hittest_data); | 101 hittest_data); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 158 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); |
| 149 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 159 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 150 InputEventRouterGestureTargetQueueTest); | 160 InputEventRouterGestureTargetQueueTest); |
| 151 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 161 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 152 InputEventRouterTouchpadGestureTargetTest); | 162 InputEventRouterTouchpadGestureTargetTest); |
| 153 }; | 163 }; |
| 154 | 164 |
| 155 } // namespace content | 165 } // namespace content |
| 156 | 166 |
| 157 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ | 167 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ |
| OLD | NEW |