| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |