| 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/wm/panels/panel_window_resizer.h" | 5 #include "ash/wm/panels/panel_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/launcher/launcher_model.h" | 8 #include "ash/launcher/launcher_model.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 // Test dragging panel window along the shelf and verify that panel icons | 152 // Test dragging panel window along the shelf and verify that panel icons |
| 153 // are reordered appropriately. | 153 // are reordered appropriately. |
| 154 void DragAlongShelfReorder(int dx, int dy) { | 154 void DragAlongShelfReorder(int dx, int dy) { |
| 155 gfx::Rect bounds(0, 0, 201, 201); | 155 gfx::Rect bounds(0, 0, 201, 201); |
| 156 scoped_ptr<aura::Window> w1(CreatePanelWindow(bounds)); | 156 scoped_ptr<aura::Window> w1(CreatePanelWindow(bounds)); |
| 157 scoped_ptr<aura::Window> w2(CreatePanelWindow(bounds)); | 157 scoped_ptr<aura::Window> w2(CreatePanelWindow(bounds)); |
| 158 std::vector<aura::Window*> window_order_original; | 158 std::vector<aura::Window*> window_order_original; |
| 159 std::vector<aura::Window*> window_order_swapped; | 159 std::vector<aura::Window*> window_order_swapped; |
| 160 window_order_original.push_back(w2.get()); |
| 160 window_order_original.push_back(w1.get()); | 161 window_order_original.push_back(w1.get()); |
| 161 window_order_original.push_back(w2.get()); | 162 window_order_swapped.push_back(w1.get()); |
| 162 window_order_swapped.push_back(w2.get()); | 163 window_order_swapped.push_back(w2.get()); |
| 163 window_order_swapped.push_back(w1.get()); | |
| 164 TestWindowOrder(window_order_original); | 164 TestWindowOrder(window_order_original); |
| 165 | 165 |
| 166 // Drag window #2 to the beginning of the shelf. | 166 // Drag window #1 to the beginning of the shelf. |
| 167 DragStart(w2.get()); | 167 DragStart(w1.get()); |
| 168 DragMove(400 * dx, 400 * dy); | 168 DragMove(400 * dx, 400 * dy); |
| 169 TestWindowOrder(window_order_swapped); | 169 TestWindowOrder(window_order_swapped); |
| 170 DragEnd(); | 170 DragEnd(); |
| 171 | 171 |
| 172 // Expect swapped window order. | 172 // Expect swapped window order. |
| 173 TestWindowOrder(window_order_swapped); | 173 TestWindowOrder(window_order_swapped); |
| 174 | 174 |
| 175 // Drag window #2 back to the end. | 175 // Drag window #1 back to the end. |
| 176 DragStart(w2.get()); | 176 DragStart(w1.get()); |
| 177 DragMove(-400 * dx, -400 * dy); | 177 DragMove(-400 * dx, -400 * dy); |
| 178 TestWindowOrder(window_order_original); | 178 TestWindowOrder(window_order_original); |
| 179 DragEnd(); | 179 DragEnd(); |
| 180 | 180 |
| 181 // Expect original order. | 181 // Expect original order. |
| 182 TestWindowOrder(window_order_original); | 182 TestWindowOrder(window_order_original); |
| 183 } | 183 } |
| 184 | 184 |
| 185 private: | 185 private: |
| 186 scoped_ptr<WindowResizer> resizer_; | 186 scoped_ptr<WindowResizer> resizer_; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 ash::Shell* shell = ash::Shell::GetInstance(); | 439 ash::Shell* shell = ash::Shell::GetInstance(); |
| 440 shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow()); | 440 shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow()); |
| 441 DragAlongShelfReorder(0, -1); | 441 DragAlongShelfReorder(0, -1); |
| 442 } | 442 } |
| 443 | 443 |
| 444 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, | 444 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, |
| 445 testing::Bool()); | 445 testing::Bool()); |
| 446 | 446 |
| 447 } // namespace internal | 447 } // namespace internal |
| 448 } // namespace ash | 448 } // namespace ash |
| OLD | NEW |