| 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/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
| 9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_button.h" | 10 #include "ash/shelf/shelf_button.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 std::find(manager->panel_windows_.begin(), | 88 std::find(manager->panel_windows_.begin(), |
| 89 manager->panel_windows_.end(), wm_panel); | 89 manager->panel_windows_.end(), wm_panel); |
| 90 DCHECK(found != manager->panel_windows_.end()); | 90 DCHECK(found != manager->panel_windows_.end()); |
| 91 DCHECK(found->callout_widget); | 91 DCHECK(found->callout_widget); |
| 92 return found->CalloutWidget(); | 92 return found->CalloutWidget(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void PanelInScreen(aura::Window* panel) { | 95 void PanelInScreen(aura::Window* panel) { |
| 96 gfx::Rect panel_bounds = panel->GetBoundsInRootWindow(); | 96 gfx::Rect panel_bounds = panel->GetBoundsInRootWindow(); |
| 97 gfx::Point root_point = gfx::Point(panel_bounds.x(), panel_bounds.y()); | 97 gfx::Point root_point = gfx::Point(panel_bounds.x(), panel_bounds.y()); |
| 98 gfx::Display display = ScreenUtil::FindDisplayContainingPoint(root_point); | 98 display::Display display = |
| 99 ScreenUtil::FindDisplayContainingPoint(root_point); |
| 99 | 100 |
| 100 gfx::Rect panel_bounds_in_screen = panel->GetBoundsInScreen(); | 101 gfx::Rect panel_bounds_in_screen = panel->GetBoundsInScreen(); |
| 101 gfx::Point screen_bottom_right = gfx::Point( | 102 gfx::Point screen_bottom_right = gfx::Point( |
| 102 panel_bounds_in_screen.right(), | 103 panel_bounds_in_screen.right(), |
| 103 panel_bounds_in_screen.bottom()); | 104 panel_bounds_in_screen.bottom()); |
| 104 gfx::Rect display_bounds = display.bounds(); | 105 gfx::Rect display_bounds = display.bounds(); |
| 105 EXPECT_TRUE(screen_bottom_right.x() < display_bounds.width() && | 106 EXPECT_TRUE(screen_bottom_right.x() < display_bounds.width() && |
| 106 screen_bottom_right.y() < display_bounds.height()); | 107 screen_bottom_right.y() < display_bounds.height()); |
| 107 } | 108 } |
| 108 | 109 |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 // Hit test outside the left edge with a left-aligned shelf. | 813 // Hit test outside the left edge with a left-aligned shelf. |
| 813 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); | 814 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); |
| 814 target = targeter->FindTargetForEvent(root, &touch); | 815 target = targeter->FindTargetForEvent(root, &touch); |
| 815 EXPECT_NE(w.get(), target); | 816 EXPECT_NE(w.get(), target); |
| 816 } | 817 } |
| 817 | 818 |
| 818 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, | 819 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, |
| 819 testing::Bool()); | 820 testing::Bool()); |
| 820 | 821 |
| 821 } // namespace ash | 822 } // namespace ash |
| OLD | NEW |