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

Side by Side Diff: ash/wm/ash_native_cursor_manager_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 "ash/wm/ash_native_cursor_manager.h" 5 #include "ash/wm/ash_native_cursor_manager.h"
6 6
7 #include "ash/display/display_info.h" 7 #include "ash/display/display_info.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 22 matching lines...) Expand all
33 MouseEventLocationDelegate() {} 33 MouseEventLocationDelegate() {}
34 virtual ~MouseEventLocationDelegate() {} 34 virtual ~MouseEventLocationDelegate() {}
35 35
36 gfx::Point GetMouseEventLocationAndReset() { 36 gfx::Point GetMouseEventLocationAndReset() {
37 gfx::Point p = mouse_event_location_; 37 gfx::Point p = mouse_event_location_;
38 mouse_event_location_.SetPoint(-100, -100); 38 mouse_event_location_.SetPoint(-100, -100);
39 return p; 39 return p;
40 } 40 }
41 41
42 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE { 42 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE {
43 mouse_event_location_ = event->location(); 43 mouse_event_location_ = gfx::ToFlooredPoint(event->location());
44 event->SetHandled(); 44 event->SetHandled();
45 } 45 }
46 46
47 private: 47 private:
48 gfx::Point mouse_event_location_; 48 gfx::Point mouse_event_location_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(MouseEventLocationDelegate); 50 DISALLOW_COPY_AND_ASSIGN(MouseEventLocationDelegate);
51 }; 51 };
52 52
53 } // namespace 53 } // namespace
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 170 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
171 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); 171 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
172 display_manager->SetDisplayUIScale(display_id, 2.0f); 172 display_manager->SetDisplayUIScale(display_id, 2.0f);
173 EXPECT_EQ(1.0f, 173 EXPECT_EQ(1.0f,
174 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 174 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
175 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); 175 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
176 } 176 }
177 177
178 } // namespace test 178 } // namespace test
179 } // namespace ash 179 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698