| 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 23 matching lines...) Expand all Loading... |
| 74 | 75 |
| 75 void AddSurfaceClientIdOwner(uint32_t id, RenderWidgetHostViewBase* owner); | 76 void AddSurfaceClientIdOwner(uint32_t id, RenderWidgetHostViewBase* owner); |
| 76 void RemoveSurfaceClientIdOwner(uint32_t id); | 77 void RemoveSurfaceClientIdOwner(uint32_t id); |
| 77 | 78 |
| 78 bool is_registered(uint32_t id) { | 79 bool is_registered(uint32_t id) { |
| 79 return owner_map_.find(id) != owner_map_.end(); | 80 return owner_map_.find(id) != owner_map_.end(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void OnHittestData(const FrameHostMsg_HittestData_Params& params); | 83 void OnHittestData(const FrameHostMsg_HittestData_Params& params); |
| 83 | 84 |
| 85 // Returns the RenderWidgetHostImpl inside the |root_view| at |point| where |
| 86 // |point| is with respect to |root_view|'s coordinates. If a RWHI is found, |
| 87 // the value of |transformed_point| is the coordinate of the point with |
| 88 // respect to the RWHI's coordinates. |
| 89 RenderWidgetHostImpl* GetRenderWidgetHostAtPoint( |
| 90 RenderWidgetHostViewBase* root_view, |
| 91 const gfx::Point& point, |
| 92 gfx::Point* transformed_point); |
| 93 |
| 84 private: | 94 private: |
| 85 struct HittestData { | 95 struct HittestData { |
| 86 bool ignored_for_hittest; | 96 bool ignored_for_hittest; |
| 87 }; | 97 }; |
| 88 | 98 |
| 89 class HittestDelegate : public cc::SurfaceHittestDelegate { | 99 class HittestDelegate : public cc::SurfaceHittestDelegate { |
| 90 public: | 100 public: |
| 91 HittestDelegate( | 101 HittestDelegate( |
| 92 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& | 102 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& |
| 93 hittest_data); | 103 hittest_data); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); | 176 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); |
| 167 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 177 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 168 InputEventRouterGestureTargetQueueTest); | 178 InputEventRouterGestureTargetQueueTest); |
| 169 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, | 179 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, |
| 170 InputEventRouterTouchpadGestureTargetTest); | 180 InputEventRouterTouchpadGestureTargetTest); |
| 171 }; | 181 }; |
| 172 | 182 |
| 173 } // namespace content | 183 } // namespace content |
| 174 | 184 |
| 175 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ | 185 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H
_ |
| OLD | NEW |