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

Side by Side Diff: mojo/ui/associates/mock_hit_tester.cc

Issue 1782733002: Mozart: The great RectF-ication. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-9
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « mojo/ui/associates/mock_hit_tester.h ('k') | mojo/ui/associates/test_helpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #include "mojo/ui/associates/mock_hit_tester.h" 5 #include "mojo/ui/associates/mock_hit_tester.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace ui { 10 namespace ui {
11 11
12 MockHitTester::MockHitTester() {} 12 MockHitTester::MockHitTester() {}
13 13
14 MockHitTester::~MockHitTester() {} 14 MockHitTester::~MockHitTester() {}
15 15
16 void MockHitTester::SetNextResult( 16 void MockHitTester::SetNextResult(
17 mojo::PointPtr point, 17 mojo::PointFPtr point,
18 mojo::gfx::composition::HitTestResultPtr result) { 18 mojo::gfx::composition::HitTestResultPtr result) {
19 DCHECK(point); 19 DCHECK(point);
20 DCHECK(result); 20 DCHECK(result);
21 21
22 point_ = point.Pass(); 22 point_ = point.Pass();
23 result_ = result.Pass(); 23 result_ = result.Pass();
24 } 24 }
25 25
26 void MockHitTester::HitTest(mojo::PointPtr point, 26 void MockHitTester::HitTest(mojo::PointFPtr point,
27 const HitTestCallback& callback) { 27 const HitTestCallback& callback) {
28 DCHECK(point); 28 DCHECK(point);
29 29
30 if (point.Equals(point_)) { 30 if (point.Equals(point_)) {
31 point_.reset(); 31 point_.reset();
32 callback.Run(result_.Pass()); 32 callback.Run(result_.Pass());
33 } else { 33 } else {
34 callback.Run(mojo::gfx::composition::HitTestResult::New()); 34 callback.Run(mojo::gfx::composition::HitTestResult::New());
35 } 35 }
36 } 36 }
37 37
38 } // namespace ui 38 } // namespace ui
39 } // namespace mojo 39 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/ui/associates/mock_hit_tester.h ('k') | mojo/ui/associates/test_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698