| 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/common/shelf/shelf_layout_manager.h" | 7 #include "ash/common/shelf/shelf_layout_manager.h" |
| 8 #include "ash/common/shelf/shelf_model.h" | 8 #include "ash/common/shelf/shelf_model.h" |
| 9 #include "ash/common/shelf/shelf_widget.h" | 9 #include "ash/common/shelf/shelf_widget.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 11 #include "ash/common/test/test_shelf_delegate.h" | 11 #include "ash/common/test/test_shelf_delegate.h" |
| 12 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
| 13 #include "ash/common/wm/wm_event.h" | 13 #include "ash/common/wm/wm_event.h" |
| 14 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 15 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 16 #include "ash/common/wm_window_property.h" | |
| 17 #include "ash/public/cpp/shelf_types.h" | 16 #include "ash/public/cpp/shelf_types.h" |
| 18 #include "ash/public/cpp/shell_window_ids.h" | 17 #include "ash/public/cpp/shell_window_ids.h" |
| 19 #include "ash/public/cpp/window_properties.h" | 18 #include "ash/public/cpp/window_properties.h" |
| 20 #include "ash/root_window_controller.h" | 19 #include "ash/root_window_controller.h" |
| 21 #include "ash/shell.h" | 20 #include "ash/shell.h" |
| 22 #include "ash/test/ash_test_base.h" | 21 #include "ash/test/ash_test_base.h" |
| 23 #include "ash/test/cursor_manager_test_api.h" | 22 #include "ash/test/cursor_manager_test_api.h" |
| 24 #include "ash/wm/drag_window_resizer.h" | 23 #include "ash/wm/drag_window_resizer.h" |
| 25 #include "ash/wm/window_state_aura.h" | 24 #include "ash/wm/window_state_aura.h" |
| 26 #include "base/i18n/rtl.h" | 25 #include "base/i18n/rtl.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y()); | 124 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y()); |
| 126 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id()); | 125 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id()); |
| 127 } | 126 } |
| 128 | 127 |
| 129 void TestWindowOrder(const std::vector<aura::Window*>& window_order) { | 128 void TestWindowOrder(const std::vector<aura::Window*>& window_order) { |
| 130 int panel_index = model_->FirstPanelIndex(); | 129 int panel_index = model_->FirstPanelIndex(); |
| 131 EXPECT_EQ((int)(panel_index + window_order.size()), model_->item_count()); | 130 EXPECT_EQ((int)(panel_index + window_order.size()), model_->item_count()); |
| 132 for (std::vector<aura::Window *>::const_iterator | 131 for (std::vector<aura::Window *>::const_iterator |
| 133 iter = window_order.begin(); | 132 iter = window_order.begin(); |
| 134 iter != window_order.end(); ++iter, ++panel_index) { | 133 iter != window_order.end(); ++iter, ++panel_index) { |
| 135 ShelfID id = | 134 ShelfID id = *iter->GetProperty(kShelfIDKey); |
| 136 WmWindow::Get(*iter)->GetIntProperty(WmWindowProperty::SHELF_ID); | |
| 137 EXPECT_EQ(id, model_->items()[panel_index].id); | 135 EXPECT_EQ(id, model_->items()[panel_index].id); |
| 138 } | 136 } |
| 139 } | 137 } |
| 140 | 138 |
| 141 // Test dragging panel window along the shelf and verify that panel icons | 139 // Test dragging panel window along the shelf and verify that panel icons |
| 142 // are reordered appropriately. | 140 // are reordered appropriately. |
| 143 void DragAlongShelfReorder(int dx, int dy) { | 141 void DragAlongShelfReorder(int dx, int dy) { |
| 144 gfx::Point origin(0, 0); | 142 gfx::Point origin(0, 0); |
| 145 std::unique_ptr<aura::Window> w1(CreatePanelWindow(origin)); | 143 std::unique_ptr<aura::Window> w1(CreatePanelWindow(origin)); |
| 146 std::unique_ptr<aura::Window> w2(CreatePanelWindow(origin)); | 144 std::unique_ptr<aura::Window> w2(CreatePanelWindow(origin)); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 INSTANTIATE_TEST_CASE_P(LtrRtl, | 514 INSTANTIATE_TEST_CASE_P(LtrRtl, |
| 517 PanelWindowResizerTextDirectionTest, | 515 PanelWindowResizerTextDirectionTest, |
| 518 testing::Bool()); | 516 testing::Bool()); |
| 519 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 517 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
| 520 PanelWindowResizerTransientTest, | 518 PanelWindowResizerTransientTest, |
| 521 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 519 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 522 ui::wm::WINDOW_TYPE_PANEL, | 520 ui::wm::WINDOW_TYPE_PANEL, |
| 523 ui::wm::WINDOW_TYPE_POPUP)); | 521 ui::wm::WINDOW_TYPE_POPUP)); |
| 524 | 522 |
| 525 } // namespace ash | 523 } // namespace ash |
| OLD | NEW |