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/common/wm/panels/panel_layout_manager.h" | 5 #include "ash/common/wm/panels/panel_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
9 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
10 #include "ash/screen_util.h" | 11 #include "ash/screen_util.h" |
11 #include "ash/shelf/shelf.h" | 12 #include "ash/shelf/shelf.h" |
12 #include "ash/shelf/shelf_button.h" | 13 #include "ash/shelf/shelf_button.h" |
13 #include "ash/shelf/shelf_layout_manager.h" | 14 #include "ash/shelf/shelf_layout_manager.h" |
14 #include "ash/shelf/shelf_model.h" | 15 #include "ash/shelf/shelf_model.h" |
15 #include "ash/shelf/shelf_types.h" | 16 #include "ash/shelf/shelf_types.h" |
16 #include "ash/shelf/shelf_util.h" | 17 #include "ash/shelf/shelf_util.h" |
17 #include "ash/shelf/shelf_view.h" | 18 #include "ash/shelf/shelf_view.h" |
18 #include "ash/shelf/shelf_widget.h" | 19 #include "ash/shelf/shelf_widget.h" |
19 #include "ash/shell.h" | 20 #include "ash/shell.h" |
20 #include "ash/test/ash_test_base.h" | 21 #include "ash/test/ash_test_base.h" |
21 #include "ash/test/shelf_test_api.h" | 22 #include "ash/test/shelf_test_api.h" |
22 #include "ash/test/shelf_view_test_api.h" | 23 #include "ash/test/shelf_view_test_api.h" |
23 #include "ash/test/shell_test_api.h" | 24 #include "ash/test/shell_test_api.h" |
24 #include "ash/test/test_shelf_delegate.h" | 25 #include "ash/test/test_shelf_delegate.h" |
25 #include "ash/wm/aura/wm_window_aura.h" | |
26 #include "ash/wm/mru_window_tracker.h" | 26 #include "ash/wm/mru_window_tracker.h" |
27 #include "ash/wm/window_state_aura.h" | 27 #include "ash/wm/window_state_aura.h" |
28 #include "ash/wm/window_util.h" | 28 #include "ash/wm/window_util.h" |
29 #include "base/command_line.h" | 29 #include "base/command_line.h" |
30 #include "base/compiler_specific.h" | 30 #include "base/compiler_specific.h" |
31 #include "base/i18n/rtl.h" | 31 #include "base/i18n/rtl.h" |
32 #include "base/run_loop.h" | 32 #include "base/run_loop.h" |
33 #include "ui/aura/client/aura_constants.h" | 33 #include "ui/aura/client/aura_constants.h" |
34 #include "ui/aura/test/test_windows.h" | 34 #include "ui/aura/test/test_windows.h" |
35 #include "ui/aura/window.h" | 35 #include "ui/aura/window.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { | 74 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { |
75 return CreatePanelWindowWithDelegate(NULL, bounds); | 75 return CreatePanelWindowWithDelegate(NULL, bounds); |
76 } | 76 } |
77 | 77 |
78 aura::Window* GetPanelContainer(aura::Window* panel) { | 78 aura::Window* GetPanelContainer(aura::Window* panel) { |
79 return Shell::GetContainer(panel->GetRootWindow(), | 79 return Shell::GetContainer(panel->GetRootWindow(), |
80 kShellWindowId_PanelContainer); | 80 kShellWindowId_PanelContainer); |
81 } | 81 } |
82 | 82 |
83 views::Widget* GetCalloutWidgetForPanel(aura::Window* panel) { | 83 views::Widget* GetCalloutWidgetForPanel(aura::Window* panel) { |
84 wm::WmWindow* wm_panel = wm::WmWindowAura::Get(panel); | 84 WmWindow* wm_panel = WmWindowAura::Get(panel); |
85 PanelLayoutManager* manager = PanelLayoutManager::Get(wm_panel); | 85 PanelLayoutManager* manager = PanelLayoutManager::Get(wm_panel); |
86 DCHECK(manager); | 86 DCHECK(manager); |
87 PanelLayoutManager::PanelList::iterator found = | 87 PanelLayoutManager::PanelList::iterator found = |
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 |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 // Hit test outside the left edge with a left-aligned shelf. | 813 // Hit test outside the left edge with a left-aligned shelf. |
814 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); | 814 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); |
815 target = targeter->FindTargetForEvent(root, &touch); | 815 target = targeter->FindTargetForEvent(root, &touch); |
816 EXPECT_NE(w.get(), target); | 816 EXPECT_NE(w.get(), target); |
817 } | 817 } |
818 | 818 |
819 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, | 819 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, |
820 testing::Bool()); | 820 testing::Bool()); |
821 | 821 |
822 } // namespace ash | 822 } // namespace ash |
OLD | NEW |