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/public/cpp/config.h" | 7 #include "ash/public/cpp/config.h" |
8 #include "ash/public/cpp/shelf_types.h" | 8 #include "ash/public/cpp/shelf_types.h" |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/public/cpp/window_properties.h" | 10 #include "ash/public/cpp/window_properties.h" |
11 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
12 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
13 #include "ash/shelf/shelf_model.h" | 13 #include "ash/shelf/shelf_model.h" |
14 #include "ash/shelf/shelf_widget.h" | 14 #include "ash/shelf/shelf_widget.h" |
15 #include "ash/shelf/wm_shelf.h" | 15 #include "ash/shelf/wm_shelf.h" |
16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
17 #include "ash/shell_port.h" | 17 #include "ash/shell_port.h" |
18 #include "ash/test/ash_test_base.h" | 18 #include "ash/test/ash_test_base.h" |
19 #include "ash/test/cursor_manager_test_api.h" | 19 #include "ash/test/cursor_manager_test_api.h" |
20 #include "ash/test/shelf_view_test_api.h" | 20 #include "ash/test/shelf_view_test_api.h" |
21 #include "ash/wm/drag_window_resizer.h" | 21 #include "ash/wm/drag_window_resizer.h" |
22 #include "ash/wm/window_properties.h" | 22 #include "ash/wm/window_properties.h" |
23 #include "ash/wm/window_state.h" | 23 #include "ash/wm/window_state.h" |
24 #include "ash/wm/window_state_aura.h" | 24 #include "ash/wm/window_state_aura.h" |
25 #include "ash/wm/wm_event.h" | 25 #include "ash/wm/wm_event.h" |
26 #include "ash/wm_window.h" | 26 #include "ash/wm_window.h" |
27 #include "base/i18n/rtl.h" | 27 #include "base/i18n/rtl.h" |
| 28 #include "base/strings/string_number_conversions.h" |
28 #include "ui/aura/client/aura_constants.h" | 29 #include "ui/aura/client/aura_constants.h" |
29 #include "ui/aura/window_event_dispatcher.h" | 30 #include "ui/aura/window_event_dispatcher.h" |
30 #include "ui/base/hit_test.h" | 31 #include "ui/base/hit_test.h" |
31 #include "ui/base/ui_base_types.h" | 32 #include "ui/base/ui_base_types.h" |
32 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
33 #include "ui/wm/core/window_util.h" | 34 #include "ui/wm/core/window_util.h" |
34 | 35 |
35 namespace ash { | 36 namespace ash { |
36 | 37 |
37 class PanelWindowResizerTest : public test::AshTestBase { | 38 class PanelWindowResizerTest : public test::AshTestBase { |
(...skipping 18 matching lines...) Expand all Loading... |
56 gfx::Point location = resizer.GetInitialLocation(); | 57 gfx::Point location = resizer.GetInitialLocation(); |
57 location.set_x(location.x() + delta_x); | 58 location.set_x(location.x() + delta_x); |
58 location.set_y(location.y() + delta_y); | 59 location.set_y(location.y() + delta_y); |
59 return location; | 60 return location; |
60 } | 61 } |
61 | 62 |
62 aura::Window* CreatePanelWindow(const gfx::Point& origin) { | 63 aura::Window* CreatePanelWindow(const gfx::Point& origin) { |
63 gfx::Rect bounds(origin, gfx::Size(101, 101)); | 64 gfx::Rect bounds(origin, gfx::Size(101, 101)); |
64 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( | 65 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
65 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); | 66 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); |
| 67 static int id = 0; |
| 68 window->SetProperty(kShelfIDKey, new ShelfID(base::IntToString(id++))); |
66 shelf_view_test_->RunMessageLoopUntilAnimationsDone(); | 69 shelf_view_test_->RunMessageLoopUntilAnimationsDone(); |
67 return window; | 70 return window; |
68 } | 71 } |
69 | 72 |
70 void DragStart(aura::Window* window) { | 73 void DragStart(aura::Window* window) { |
71 resizer_ = | 74 resizer_ = |
72 CreateWindowResizer(WmWindow::Get(window), window->bounds().origin(), | 75 CreateWindowResizer(WmWindow::Get(window), window->bounds().origin(), |
73 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE); | 76 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
74 } | 77 } |
75 | 78 |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 | 555 |
553 INSTANTIATE_TEST_CASE_P(LtrRtl, | 556 INSTANTIATE_TEST_CASE_P(LtrRtl, |
554 PanelWindowResizerTextDirectionTest, | 557 PanelWindowResizerTextDirectionTest, |
555 testing::Bool()); | 558 testing::Bool()); |
556 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 559 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
557 PanelWindowResizerTransientTest, | 560 PanelWindowResizerTransientTest, |
558 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 561 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
559 ui::wm::WINDOW_TYPE_POPUP)); | 562 ui::wm::WINDOW_TYPE_POPUP)); |
560 | 563 |
561 } // namespace ash | 564 } // namespace ash |
OLD | NEW |