OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_ |
| 6 #define MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_ |
| 7 |
| 8 #include <unordered_map> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "mojo/services/gfx/composition/interfaces/hit_tests.mojom.h" |
| 12 |
| 13 namespace mojo { |
| 14 namespace ui { |
| 15 |
| 16 // TODO(jeffbrown): Move this someplace closer to mojo::gfx::composition |
| 17 class MockHitTester : public mojo::gfx::composition::HitTester { |
| 18 public: |
| 19 MockHitTester(); |
| 20 ~MockHitTester() override; |
| 21 |
| 22 // Sets the next hit test result. |
| 23 void SetNextResult(mojo::PointPtr point, |
| 24 mojo::gfx::composition::HitTestResultPtr result); |
| 25 |
| 26 // |HitTester| |
| 27 void HitTest(mojo::PointPtr point, const HitTestCallback& callback) override; |
| 28 |
| 29 private: |
| 30 mojo::PointPtr point_; |
| 31 mojo::gfx::composition::HitTestResultPtr result_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(MockHitTester); |
| 34 }; |
| 35 |
| 36 } // namespace ui |
| 37 } // namespace mojo |
| 38 |
| 39 #endif // MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_ |
OLD | NEW |