Chromium Code Reviews| 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..81e642fe6b99b18965ceef29817f340062c2a7cb |
| --- /dev/null |
| +++ b/components/viz/host/hit_test/hit_test_query.h |
| @@ -0,0 +1,54 @@ |
| +// 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 "components/viz/common/hit_test/hit_test_export.h" |
| +#include "ui/gfx/geometry/point.h" |
| + |
| +namespace viz { |
| +namespace hit_test { |
| + |
| +struct Target { |
| + cc::FrameSinkId id; |
| + gfx::Point location_in_target; |
|
rjkroege
2017/06/15 19:58:36
the coordinate system of the target FrameSinkId...
riajiang
2017/06/16 02:56:54
Done.
|
| + // TODO(riajiang): use HitTestRegionFlags instead of int after |
| + // https://codereview.chromium.org/2908783002/ |
| + int flags; |
|
gklassen
2017/06/15 19:51:20
flags are now a uint32 instead of HitTesRegionFlag
riajiang
2017/06/16 02:56:54
Ah I see, changed to uint32.
|
| +}; |
| + |
| +// Finds the target for a given location based on DisplayHitTestData aggreated |
| +// by HitTestComponent. |
| +class HIT_TEST_EXPORT 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( |
| + std::vector<DisplayHitTestData> display_hit_test_data_list) { |
| + display_hit_test_data_list_ = display_hit_test_data_list; |
| + } |
| + |
| + // 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); |
|
rjkroege
2017/06/15 19:58:36
You have written the code that does the event disp
riajiang
2017/06/16 02:56:54
https://cs.chromium.org/chromium/src/services/ui/w
|
| + |
| + private: |
| + std::vector<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_ |