| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/common/shelf/shelf_widget.h" | 9 #include "ash/common/shelf/shelf_widget.h" |
| 10 #include "ash/display/display_util.h" | 10 #include "ash/display/display_util.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 aura::Window* target = static_cast<aura::Window*>(event->target()); | 53 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 54 mouse_location_ = event->root_location(); | 54 mouse_location_ = event->root_location(); |
| 55 target_root_ = target->GetRootWindow(); | 55 target_root_ = target->GetRootWindow(); |
| 56 event->StopPropagation(); | 56 event->StopPropagation(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void OnTouchEvent(ui::TouchEvent* event) override { | 59 void OnTouchEvent(ui::TouchEvent* event) override { |
| 60 aura::Window* target = static_cast<aura::Window*>(event->target()); | 60 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 61 // Only record when the target is the wallpaper, which covers the entire | 61 // Only record when the target is the wallpaper, which covers the entire |
| 62 // root window. | 62 // root window. |
| 63 if (target->name() != kWallpaperView) | 63 if (target->GetName() != kWallpaperView) |
| 64 return; | 64 return; |
| 65 touch_radius_x_ = event->pointer_details().radius_x; | 65 touch_radius_x_ = event->pointer_details().radius_x; |
| 66 touch_radius_y_ = event->pointer_details().radius_y; | 66 touch_radius_y_ = event->pointer_details().radius_y; |
| 67 event->StopPropagation(); | 67 event->StopPropagation(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void OnScrollEvent(ui::ScrollEvent* event) override { | 70 void OnScrollEvent(ui::ScrollEvent* event) override { |
| 71 aura::Window* target = static_cast<aura::Window*>(event->target()); | 71 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 72 // Only record when the target is the wallpaper, which covers the entire | 72 // Only record when the target is the wallpaper, which covers the entire |
| 73 // root window. | 73 // root window. |
| 74 if (target->name() != kWallpaperView) | 74 if (target->GetName() != kWallpaperView) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 if (event->type() == ui::ET_SCROLL) { | 77 if (event->type() == ui::ET_SCROLL) { |
| 78 scroll_x_offset_ = event->x_offset(); | 78 scroll_x_offset_ = event->x_offset(); |
| 79 scroll_y_offset_ = event->y_offset(); | 79 scroll_y_offset_ = event->y_offset(); |
| 80 scroll_x_offset_ordinal_ = event->x_offset_ordinal(); | 80 scroll_x_offset_ordinal_ = event->x_offset_ordinal(); |
| 81 scroll_y_offset_ordinal_ = event->y_offset_ordinal(); | 81 scroll_y_offset_ordinal_ = event->y_offset_ordinal(); |
| 82 } | 82 } |
| 83 event->StopPropagation(); | 83 event->StopPropagation(); |
| 84 } | 84 } |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. | 433 // Y margin must be margin is (500 - 500/400 * 200) / 2 = 125. |
| 434 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); | 434 EXPECT_EQ("0,125,0,125", transformer->GetHostInsets().ToString()); |
| 435 | 435 |
| 436 UpdateDisplay("200x400,500x500"); | 436 UpdateDisplay("200x400,500x500"); |
| 437 // The aspect ratio is flipped, so X margin is now 125. | 437 // The aspect ratio is flipped, so X margin is now 125. |
| 438 transformer = CreateCurrentRootWindowTransformerForMirroring(); | 438 transformer = CreateCurrentRootWindowTransformerForMirroring(); |
| 439 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); | 439 EXPECT_EQ("125,0,125,0", transformer->GetHostInsets().ToString()); |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace ash | 442 } // namespace ash |
| OLD | NEW |