Index: components/viz/host/hit_test/hit_test_query.h |
diff --git a/components/viz/host/hit_test/hit_test_query.h b/components/viz/host/hit_test/hit_test_query.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dd386afe6faba240edc51444e5260f39f651b65b |
--- /dev/null |
+++ b/components/viz/host/hit_test/hit_test_query.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_VIZ_HOST_HIT_TEST_HIT_TEST_QUERY_H_ |
+#define COMPONENTS_VIZ_HOST_HIT_TEST_HIT_TEST_QUERY_H_ |
+ |
+#include <vector> |
+ |
+#include "base/macros.h" |
+#include "components/viz/common/hit_test/display_hit_test_data.h" |
+#include "ui/gfx/geometry/point.h" |
+ |
+namespace viz { |
+namespace hit_test { |
+ |
+struct Target { |
+ cc::FrameSinkId id; |
+ // |location_in_target| is in the coordinate system of the target FrameSinkId. |
+ gfx::Point location_in_target; |
+ uint32_t flags; |
sadrul
2017/06/16 17:09:51
Add a comment to point to where the flags are defi
riajiang
2017/06/23 02:46:37
Done.
|
+}; |
+ |
+// Finds the target for a given location based on DisplayHitTestData aggreated |
+// by HitTestComponent. |
+class HitTestQuery { |
+ public: |
+ HitTestQuery(); |
+ ~HitTestQuery(); |
+ |
+ // TODO(riajiang): Read from shmem directly once it's set up and delete this |
+ // function. For now, use fake data. |
+ void set_display_hit_test_data_list( |
+ DisplayHitTestData display_hit_test_data_list) { |
+ display_hit_test_data_list_ = display_hit_test_data_list; |
sadrul
2017/06/16 17:09:51
Use std::move
riajiang
2017/06/23 02:46:36
Done.
|
+ } |
+ |
+ // Find Target for |location_in_root|, including the FrameSinkId of the |
+ // target, updated location in the coordinate system of the target and |
+ // hit-test flags for the target. |
+ Target FindTargetForLocation(const gfx::Point& location_in_root); |
+ |
+ private: |
+ DisplayHitTestData display_hit_test_data_list_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(HitTestQuery); |
+}; |
+ |
+} // namespace hit_test |
+} // namespace viz |
+ |
+#endif // COMPONENTS_VIZ_HOST_HIT_TEST_HIT_TEST_QUERY_H_ |