| 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/panel_layout_manager.h" | 5 #include "ash/wm/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/launcher/launcher_button.h" | 9 #include "ash/launcher/launcher_button.h" |
| 10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
| 11 #include "ash/launcher/launcher_view.h" | 11 #include "ash/launcher/launcher_view.h" |
| 12 #include "ash/root_window_controller.h" |
| 12 #include "ash/screen_ash.h" | 13 #include "ash/screen_ash.h" |
| 14 #include "ash/shelf/shelf_widget.h" |
| 13 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 14 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
| 15 #include "ash/test/ash_test_base.h" | 17 #include "ash/test/ash_test_base.h" |
| 16 #include "ash/test/launcher_view_test_api.h" | 18 #include "ash/test/launcher_view_test_api.h" |
| 17 #include "ash/test/shell_test_api.h" | 19 #include "ash/test/shell_test_api.h" |
| 18 #include "ash/test/test_launcher_delegate.h" | 20 #include "ash/test/test_launcher_delegate.h" |
| 19 #include "ash/wm/window_util.h" | 21 #include "ash/wm/window_util.h" |
| 20 #include "base/basictypes.h" | 22 #include "base/basictypes.h" |
| 21 #include "base/command_line.h" | 23 #include "base/command_line.h" |
| 22 #include "base/compiler_specific.h" | 24 #include "base/compiler_specific.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 Launcher* launcher = Launcher::ForPrimaryDisplay(); | 118 Launcher* launcher = Launcher::ForPrimaryDisplay(); |
| 117 gfx::Rect icon_bounds = launcher->GetScreenBoundsOfItemIconForWindow(panel); | 119 gfx::Rect icon_bounds = launcher->GetScreenBoundsOfItemIconForWindow(panel); |
| 118 ASSERT_FALSE(icon_bounds.IsEmpty()); | 120 ASSERT_FALSE(icon_bounds.IsEmpty()); |
| 119 | 121 |
| 120 gfx::Rect window_bounds = panel->GetBoundsInRootWindow(); | 122 gfx::Rect window_bounds = panel->GetBoundsInRootWindow(); |
| 121 | 123 |
| 122 // The horizontal bounds of the panel window should contain the bounds of | 124 // The horizontal bounds of the panel window should contain the bounds of |
| 123 // the launcher icon. | 125 // the launcher icon. |
| 124 EXPECT_LE(window_bounds.x(), icon_bounds.x()); | 126 EXPECT_LE(window_bounds.x(), icon_bounds.x()); |
| 125 EXPECT_GE(window_bounds.right(), icon_bounds.right()); | 127 EXPECT_GE(window_bounds.right(), icon_bounds.right()); |
| 126 EXPECT_EQ(launcher->widget()->GetWindowBoundsInScreen().y(), | 128 EXPECT_EQ(launcher->shelf_widget()->GetWindowBoundsInScreen().y(), |
| 127 window_bounds.bottom()); | 129 window_bounds.bottom()); |
| 128 } | 130 } |
| 129 | 131 |
| 130 void IsCalloutAboveLauncherIcon(aura::Window* panel) { | 132 void IsCalloutAboveLauncherIcon(aura::Window* panel) { |
| 131 // Flush the message loop, since callout updates use a delayed task. | 133 // Flush the message loop, since callout updates use a delayed task. |
| 132 MessageLoop::current()->RunUntilIdle(); | 134 MessageLoop::current()->RunUntilIdle(); |
| 133 views::Widget* widget = NULL; | 135 views::Widget* widget = NULL; |
| 134 GetCalloutWidgetForPanel(panel, &widget); | 136 GetCalloutWidgetForPanel(panel, &widget); |
| 135 | 137 |
| 136 Launcher* launcher = Launcher::ForPrimaryDisplay(); | 138 Launcher* launcher = Launcher::ForPrimaryDisplay(); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 EXPECT_EQ(root_windows[1], p1_d1->GetRootWindow()); | 459 EXPECT_EQ(root_windows[1], p1_d1->GetRootWindow()); |
| 458 EXPECT_EQ(root_windows[0], p2_d1->GetRootWindow()); | 460 EXPECT_EQ(root_windows[0], p2_d1->GetRootWindow()); |
| 459 EXPECT_EQ(root_windows[0], p1_d2->GetRootWindow()); | 461 EXPECT_EQ(root_windows[0], p1_d2->GetRootWindow()); |
| 460 EXPECT_EQ(root_windows[1], p2_d2->GetRootWindow()); | 462 EXPECT_EQ(root_windows[1], p2_d2->GetRootWindow()); |
| 461 EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains( | 463 EXPECT_TRUE(root_windows[0]->GetBoundsInScreen().Contains( |
| 462 p1_d2->GetBoundsInScreen())); | 464 p1_d2->GetBoundsInScreen())); |
| 463 } | 465 } |
| 464 | 466 |
| 465 } // namespace internal | 467 } // namespace internal |
| 466 } // namespace ash | 468 } // namespace ash |
| OLD | NEW |