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/toplevel_window_event_handler.h" | 5 #include "ash/wm/toplevel_window_event_handler.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 target_->AddChild(child); | 710 target_->AddChild(child); |
711 | 711 |
712 gfx::Insets mouse_outer_insets(-ash::kResizeOutsideBoundsSize, | 712 gfx::Insets mouse_outer_insets(-ash::kResizeOutsideBoundsSize, |
713 -ash::kResizeOutsideBoundsSize, | 713 -ash::kResizeOutsideBoundsSize, |
714 -ash::kResizeOutsideBoundsSize, | 714 -ash::kResizeOutsideBoundsSize, |
715 -ash::kResizeOutsideBoundsSize); | 715 -ash::kResizeOutsideBoundsSize); |
716 gfx::Insets touch_outer_insets = | 716 gfx::Insets touch_outer_insets = |
717 mouse_outer_insets.Scale(ash::kResizeOutsideBoundsScaleForTouch); | 717 mouse_outer_insets.Scale(ash::kResizeOutsideBoundsScaleForTouch); |
718 target_->SetHitTestBoundsOverrideOuter(mouse_outer_insets, | 718 target_->SetHitTestBoundsOverrideOuter(mouse_outer_insets, |
719 touch_outer_insets); | 719 touch_outer_insets); |
720 target_->set_hit_test_bounds_override_inner( | 720 gfx::Insets inner_insets(ash::kResizeInsideBoundsSize, |
721 gfx::Insets(ash::kResizeInsideBoundsSize, | 721 ash::kResizeInsideBoundsSize, |
722 ash::kResizeInsideBoundsSize, | 722 ash::kResizeInsideBoundsSize, |
723 ash::kResizeInsideBoundsSize, | 723 ash::kResizeInsideBoundsSize); |
724 ash::kResizeInsideBoundsSize)); | 724 target_->SetHitTestBoundsOverrideInner(inner_insets, inner_insets); |
725 } | 725 } |
726 | 726 |
727 virtual void TearDown() OVERRIDE { | 727 virtual void TearDown() OVERRIDE { |
728 target_.reset(); | 728 target_.reset(); |
729 ToplevelWindowEventHandlerTest::TearDown(); | 729 ToplevelWindowEventHandlerTest::TearDown(); |
730 } | 730 } |
731 | 731 |
732 // Called on each scroll event. Checks if the correct resize shadow is shown. | 732 // Called on each scroll event. Checks if the correct resize shadow is shown. |
733 void ProcessEvent(ui::EventType type, const gfx::Vector2dF& delta) { | 733 void ProcessEvent(ui::EventType type, const gfx::Vector2dF& delta) { |
734 if (type == ui::ET_GESTURE_SCROLL_END) { | 734 if (type == ui::ET_GESTURE_SCROLL_END) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 | 833 |
834 // Move mouse out of the window. Shadows should disappear. | 834 // Move mouse out of the window. Shadows should disappear. |
835 generator.MoveMouseTo(150, 150); | 835 generator.MoveMouseTo(150, 150); |
836 EXPECT_FALSE(HasResizeShadow()); | 836 EXPECT_FALSE(HasResizeShadow()); |
837 | 837 |
838 RunAllPendingInMessageLoop(); | 838 RunAllPendingInMessageLoop(); |
839 } | 839 } |
840 | 840 |
841 } // namespace test | 841 } // namespace test |
842 } // namespace ash | 842 } // namespace ash |
OLD | NEW |