Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: content/browser/renderer_host/render_widget_host_input_event_router.h

Issue 1489913003: Handle pointer-events: none in browser process hittesting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implement piman@'s suggestion Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <unordered_map>
9 10
10 #include "base/containers/hash_tables.h" 11 #include "base/containers/hash_tables.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "cc/surfaces/surface_hittest_delegate.h"
15 #include "cc/surfaces/surface_id.h"
13 #include "content/common/content_export.h" 16 #include "content/common/content_export.h"
14 17
18 struct FrameHostMsg_HittestData_Params;
19
15 namespace blink { 20 namespace blink {
16 class WebMouseEvent; 21 class WebMouseEvent;
17 class WebMouseWheelEvent; 22 class WebMouseWheelEvent;
18 class WebTouchEvent; 23 class WebTouchEvent;
19 } 24 }
20 25
21 namespace gfx { 26 namespace gfx {
22 class Point; 27 class Point;
23 } 28 }
24 29
(...skipping 24 matching lines...) Expand all
49 blink::WebTouchEvent *event, 54 blink::WebTouchEvent *event,
50 const ui::LatencyInfo& latency); 55 const ui::LatencyInfo& latency);
51 56
52 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner); 57 void AddSurfaceIdNamespaceOwner(uint32_t id, RenderWidgetHostViewBase* owner);
53 void RemoveSurfaceIdNamespaceOwner(uint32_t id); 58 void RemoveSurfaceIdNamespaceOwner(uint32_t id);
54 59
55 bool is_registered(uint32_t id) { 60 bool is_registered(uint32_t id) {
56 return owner_map_.find(id) != owner_map_.end(); 61 return owner_map_.find(id) != owner_map_.end();
57 } 62 }
58 63
64 void OnHittestData(const FrameHostMsg_HittestData_Params& params);
65
59 private: 66 private:
67 struct HittestData {
68 bool ignored_for_hittest_;
piman 2016/01/16 01:25:36 nit: style for public struct members is without a
lfg 2016/01/18 21:35:20 Done.
69 };
70
71 class HittestDelegate : public cc::SurfaceHittestDelegate {
72 public:
73 HittestDelegate(
74 const std::unordered_map<cc::SurfaceId, HittestData>& hittest_data);
75 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad,
76 const gfx::Point& point_in_quad_space) override;
77
78 const std::unordered_map<cc::SurfaceId, HittestData>& hittest_data_;
79 };
80
60 using WeakTarget = base::WeakPtr<RenderWidgetHostViewBase>; 81 using WeakTarget = base::WeakPtr<RenderWidgetHostViewBase>;
61 using SurfaceIdNamespaceOwnerMap = 82 using SurfaceIdNamespaceOwnerMap =
62 base::hash_map<uint32_t, base::WeakPtr<RenderWidgetHostViewBase>>; 83 base::hash_map<uint32_t, base::WeakPtr<RenderWidgetHostViewBase>>;
63 84
64 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, 85 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view,
65 const gfx::Point& point, 86 const gfx::Point& point,
66 gfx::Point* transformed_point); 87 gfx::Point* transformed_point);
67 88
68 SurfaceIdNamespaceOwnerMap owner_map_; 89 SurfaceIdNamespaceOwnerMap owner_map_;
69 WeakTarget current_touch_target_; 90 WeakTarget current_touch_target_;
70 int active_touches_; 91 int active_touches_;
92 std::unordered_map<cc::SurfaceId, HittestData> hittest_data_;
71 93
72 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); 94 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter);
73 }; 95 };
74 96
75 } // namespace content 97 } // namespace content
76 98
77 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _ 99 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698