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

Side by Side Diff: ui/aura/window_unittest.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 DISALLOW_COPY_AND_ASSIGN(CaptureWindowDelegateImpl); 199 DISALLOW_COPY_AND_ASSIGN(CaptureWindowDelegateImpl);
200 }; 200 };
201 201
202 // Keeps track of the location of the gesture. 202 // Keeps track of the location of the gesture.
203 class GestureTrackPositionDelegate : public TestWindowDelegate { 203 class GestureTrackPositionDelegate : public TestWindowDelegate {
204 public: 204 public:
205 GestureTrackPositionDelegate() {} 205 GestureTrackPositionDelegate() {}
206 206
207 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { 207 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
208 position_ = event->location(); 208 position_ = gfx::ToFlooredPoint(event->location());
209 event->StopPropagation(); 209 event->StopPropagation();
210 } 210 }
211 211
212 const gfx::Point& position() const { return position_; } 212 const gfx::Point& position() const { return position_; }
213 213
214 private: 214 private:
215 gfx::Point position_; 215 gfx::Point position_;
216 216
217 DISALLOW_COPY_AND_ASSIGN(GestureTrackPositionDelegate); 217 DISALLOW_COPY_AND_ASSIGN(GestureTrackPositionDelegate);
218 }; 218 };
(...skipping 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3344 BuildRootLayerTreeDescription(*root.layer())) 3344 BuildRootLayerTreeDescription(*root.layer()))
3345 << "layer tree doesn't match at " << i; 3345 << "layer tree doesn't match at " << i;
3346 EXPECT_EQ(data[i].expected_description, 3346 EXPECT_EQ(data[i].expected_description,
3347 BuildRootWindowTreeDescription(root)) 3347 BuildRootWindowTreeDescription(root))
3348 << "window tree doesn't match at " << i; 3348 << "window tree doesn't match at " << i;
3349 } 3349 }
3350 } 3350 }
3351 3351
3352 } // namespace test 3352 } // namespace test
3353 } // namespace aura 3353 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_targeter.cc ('k') | ui/events/event.h » ('j') | ui/events/event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698