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

Unified Diff: mojo/ui/associates/mock_hit_tester.h

Issue 1778593003: Mozart: Add helpers for building view associates. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-6
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/ui/associates/BUILD.gn ('k') | mojo/ui/associates/mock_hit_tester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/ui/associates/mock_hit_tester.h
diff --git a/mojo/ui/associates/mock_hit_tester.h b/mojo/ui/associates/mock_hit_tester.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ce5d7c45f253019dbacd6ab259cddf7a837357e
--- /dev/null
+++ b/mojo/ui/associates/mock_hit_tester.h
@@ -0,0 +1,39 @@
+// Copyright 2016 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 MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_
+#define MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_
+
+#include <unordered_map>
+
+#include "base/macros.h"
+#include "mojo/services/gfx/composition/interfaces/hit_tests.mojom.h"
+
+namespace mojo {
+namespace ui {
+
+// TODO(jeffbrown): Move this someplace closer to mojo::gfx::composition
+class MockHitTester : public mojo::gfx::composition::HitTester {
+ public:
+ MockHitTester();
+ ~MockHitTester() override;
+
+ // Sets the next hit test result.
+ void SetNextResult(mojo::PointPtr point,
+ mojo::gfx::composition::HitTestResultPtr result);
+
+ // |HitTester|
+ void HitTest(mojo::PointPtr point, const HitTestCallback& callback) override;
+
+ private:
+ mojo::PointPtr point_;
+ mojo::gfx::composition::HitTestResultPtr result_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockHitTester);
+};
+
+} // namespace ui
+} // namespace mojo
+
+#endif // MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_
« no previous file with comments | « mojo/ui/associates/BUILD.gn ('k') | mojo/ui/associates/mock_hit_tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698