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

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

Issue 1496103002: Reusing base::IdType<...> to implement SurfaceId. Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-id-base
Patch Set: Rebasing + dusting off... Created 4 years, 10 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 #include <unordered_map>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void OnHittestData(const FrameHostMsg_HittestData_Params& params); 64 void OnHittestData(const FrameHostMsg_HittestData_Params& params);
65 65
66 private: 66 private:
67 struct HittestData { 67 struct HittestData {
68 bool ignored_for_hittest; 68 bool ignored_for_hittest;
69 }; 69 };
70 70
71 class HittestDelegate : public cc::SurfaceHittestDelegate { 71 class HittestDelegate : public cc::SurfaceHittestDelegate {
72 public: 72 public:
73 HittestDelegate( 73 HittestDelegate(
74 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& 74 const std::unordered_map<cc::SurfaceId,
75 hittest_data); 75 HittestData,
76 cc::SurfaceId::Hasher>& hittest_data);
76 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad, 77 bool RejectHitTarget(const cc::SurfaceDrawQuad* surface_quad,
77 const gfx::Point& point_in_quad_space) override; 78 const gfx::Point& point_in_quad_space) override;
78 79
79 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash>& 80 const std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceId::Hasher>&
80 hittest_data_; 81 hittest_data_;
81 }; 82 };
82 83
83 using WeakTarget = base::WeakPtr<RenderWidgetHostViewBase>; 84 using WeakTarget = base::WeakPtr<RenderWidgetHostViewBase>;
84 using SurfaceIdNamespaceOwnerMap = 85 using SurfaceIdNamespaceOwnerMap =
85 base::hash_map<uint32_t, base::WeakPtr<RenderWidgetHostViewBase>>; 86 base::hash_map<uint32_t, base::WeakPtr<RenderWidgetHostViewBase>>;
86 87
87 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view, 88 RenderWidgetHostViewBase* FindEventTarget(RenderWidgetHostViewBase* root_view,
88 const gfx::Point& point, 89 const gfx::Point& point,
89 gfx::Point* transformed_point); 90 gfx::Point* transformed_point);
90 91
91 SurfaceIdNamespaceOwnerMap owner_map_; 92 SurfaceIdNamespaceOwnerMap owner_map_;
92 WeakTarget current_touch_target_; 93 WeakTarget current_touch_target_;
93 int active_touches_; 94 int active_touches_;
94 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceIdHash> 95 std::unordered_map<cc::SurfaceId, HittestData, cc::SurfaceId::Hasher>
95 hittest_data_; 96 hittest_data_;
96 97
97 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter); 98 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostInputEventRouter);
98 }; 99 };
99 100
100 } // namespace content 101 } // namespace content
101 102
102 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _ 103 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_INPUT_EVENT_ROUTER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698