OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/common/wm/panels/panel_window_resizer.h" | 5 #include "ash/common/wm/panels/panel_window_resizer.h" |
6 | 6 |
7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/common/shelf/shelf_layout_manager.h" | 8 #include "ash/common/shelf/shelf_layout_manager.h" |
9 #include "ash/common/shelf/shelf_model.h" | 9 #include "ash/common/shelf/shelf_model.h" |
10 #include "ash/common/shelf/shelf_types.h" | 10 #include "ash/common/shelf/shelf_types.h" |
11 #include "ash/common/shelf/shelf_widget.h" | 11 #include "ash/common/shelf/shelf_widget.h" |
12 #include "ash/common/shelf/wm_shelf.h" | 12 #include "ash/common/shelf/wm_shelf.h" |
13 #include "ash/common/shell_window_ids.h" | 13 #include "ash/common/shell_window_ids.h" |
14 #include "ash/common/wm/window_state.h" | 14 #include "ash/common/wm/window_state.h" |
15 #include "ash/common/wm/wm_event.h" | 15 #include "ash/common/wm/wm_event.h" |
16 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
| 17 #include "ash/common/wm_window_property.h" |
17 #include "ash/root_window_controller.h" | 18 #include "ash/root_window_controller.h" |
18 #include "ash/shelf/shelf_util.h" | |
19 #include "ash/shell.h" | 19 #include "ash/shell.h" |
20 #include "ash/test/ash_test_base.h" | 20 #include "ash/test/ash_test_base.h" |
21 #include "ash/test/cursor_manager_test_api.h" | 21 #include "ash/test/cursor_manager_test_api.h" |
22 #include "ash/test/test_shelf_delegate.h" | 22 #include "ash/test/test_shelf_delegate.h" |
23 #include "ash/wm/drag_window_resizer.h" | 23 #include "ash/wm/drag_window_resizer.h" |
24 #include "ash/wm/window_state_aura.h" | 24 #include "ash/wm/window_state_aura.h" |
25 #include "base/i18n/rtl.h" | 25 #include "base/i18n/rtl.h" |
26 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
27 #include "ui/aura/client/aura_constants.h" | 27 #include "ui/aura/client/aura_constants.h" |
28 #include "ui/aura/window_event_dispatcher.h" | 28 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y()); | 127 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y()); |
128 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id()); | 128 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id()); |
129 } | 129 } |
130 | 130 |
131 void TestWindowOrder(const std::vector<aura::Window*>& window_order) { | 131 void TestWindowOrder(const std::vector<aura::Window*>& window_order) { |
132 int panel_index = model_->FirstPanelIndex(); | 132 int panel_index = model_->FirstPanelIndex(); |
133 EXPECT_EQ((int)(panel_index + window_order.size()), model_->item_count()); | 133 EXPECT_EQ((int)(panel_index + window_order.size()), model_->item_count()); |
134 for (std::vector<aura::Window *>::const_iterator | 134 for (std::vector<aura::Window *>::const_iterator |
135 iter = window_order.begin(); | 135 iter = window_order.begin(); |
136 iter != window_order.end(); ++iter, ++panel_index) { | 136 iter != window_order.end(); ++iter, ++panel_index) { |
137 ShelfID id = GetShelfIDForWindow(*iter); | 137 ShelfID id = |
| 138 WmWindowAura::Get(*iter)->GetIntProperty(WmWindowProperty::SHELF_ID); |
138 EXPECT_EQ(id, model_->items()[panel_index].id); | 139 EXPECT_EQ(id, model_->items()[panel_index].id); |
139 } | 140 } |
140 } | 141 } |
141 | 142 |
142 // Test dragging panel window along the shelf and verify that panel icons | 143 // Test dragging panel window along the shelf and verify that panel icons |
143 // are reordered appropriately. | 144 // are reordered appropriately. |
144 void DragAlongShelfReorder(int dx, int dy) { | 145 void DragAlongShelfReorder(int dx, int dy) { |
145 gfx::Point origin(0, 0); | 146 gfx::Point origin(0, 0); |
146 std::unique_ptr<aura::Window> w1(CreatePanelWindow(origin)); | 147 std::unique_ptr<aura::Window> w1(CreatePanelWindow(origin)); |
147 std::unique_ptr<aura::Window> w2(CreatePanelWindow(origin)); | 148 std::unique_ptr<aura::Window> w2(CreatePanelWindow(origin)); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 INSTANTIATE_TEST_CASE_P(LtrRtl, | 557 INSTANTIATE_TEST_CASE_P(LtrRtl, |
557 PanelWindowResizerTextDirectionTest, | 558 PanelWindowResizerTextDirectionTest, |
558 testing::Bool()); | 559 testing::Bool()); |
559 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 560 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
560 PanelWindowResizerTransientTest, | 561 PanelWindowResizerTransientTest, |
561 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 562 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
562 ui::wm::WINDOW_TYPE_PANEL, | 563 ui::wm::WINDOW_TYPE_PANEL, |
563 ui::wm::WINDOW_TYPE_POPUP)); | 564 ui::wm::WINDOW_TYPE_POPUP)); |
564 | 565 |
565 } // namespace ash | 566 } // namespace ash |
OLD | NEW |