OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/display/root_window_transformers.h" | 5 #include "ash/display/root_window_transformers.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/display/display_util.h" | 9 #include "ash/display/display_util.h" |
10 #include "ash/host/root_window_transformer.h" | 10 #include "ash/host/root_window_transformer.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 target_root_ = target->GetRootWindow(); | 52 target_root_ = target->GetRootWindow(); |
53 event->StopPropagation(); | 53 event->StopPropagation(); |
54 } | 54 } |
55 | 55 |
56 void OnTouchEvent(ui::TouchEvent* event) override { | 56 void OnTouchEvent(ui::TouchEvent* event) override { |
57 aura::Window* target = static_cast<aura::Window*>(event->target()); | 57 aura::Window* target = static_cast<aura::Window*>(event->target()); |
58 // Only record when the target is the background which covers | 58 // Only record when the target is the background which covers |
59 // entire root window. | 59 // entire root window. |
60 if (target->name() != kDesktopBackgroundView) | 60 if (target->name() != kDesktopBackgroundView) |
61 return; | 61 return; |
62 touch_radius_x_ = event->radius_x(); | 62 touch_radius_x_ = event->pointer_details().radius_x(); |
63 touch_radius_y_ = event->radius_y(); | 63 touch_radius_y_ = event->pointer_details().radius_y(); |
64 event->StopPropagation(); | 64 event->StopPropagation(); |
65 } | 65 } |
66 | 66 |
67 void OnScrollEvent(ui::ScrollEvent* event) override { | 67 void OnScrollEvent(ui::ScrollEvent* event) override { |
68 aura::Window* target = static_cast<aura::Window*>(event->target()); | 68 aura::Window* target = static_cast<aura::Window*>(event->target()); |
69 // Only record when the target is the background which covers | 69 // Only record when the target is the background which covers |
70 // entire root window. | 70 // entire root window. |
71 if (target->name() != kDesktopBackgroundView) | 71 if (target->name() != kDesktopBackgroundView) |
72 return; | 72 return; |
73 | 73 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. | 412 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. |
413 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); | 413 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); |
414 | 414 |
415 UpdateDisplay("200x400,500x500"); | 415 UpdateDisplay("200x400,500x500"); |
416 // The aspect ratio is flipped, so X margin is now 125. | 416 // The aspect ratio is flipped, so X margin is now 125. |
417 transformer = CreateCurrentRootWindowTransformerForMirroring(); | 417 transformer = CreateCurrentRootWindowTransformerForMirroring(); |
418 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); | 418 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); |
419 } | 419 } |
420 | 420 |
421 } // namespace ash | 421 } // namespace ash |
OLD | NEW |