| 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/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
| 11 #include "ash/shelf/shelf_types.h" | 11 #include "ash/shelf/shelf_types.h" |
| 12 #include "ash/shelf/shelf_util.h" | 12 #include "ash/shelf/shelf_util.h" |
| 13 #include "ash/shelf/shelf_widget.h" | 13 #include "ash/shelf/shelf_widget.h" |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
| 16 #include "ash/test/ash_test_base.h" | 16 #include "ash/test/ash_test_base.h" |
| 17 #include "ash/test/cursor_manager_test_api.h" | 17 #include "ash/test/cursor_manager_test_api.h" |
| 18 #include "ash/test/shell_test_api.h" | 18 #include "ash/test/shell_test_api.h" |
| 19 #include "ash/test/test_shelf_delegate.h" | 19 #include "ash/test/test_shelf_delegate.h" |
| 20 #include "ash/wm/aura/wm_window_aura.h" |
| 20 #include "ash/wm/common/wm_event.h" | 21 #include "ash/wm/common/wm_event.h" |
| 21 #include "ash/wm/drag_window_resizer.h" | 22 #include "ash/wm/drag_window_resizer.h" |
| 22 #include "ash/wm/window_state.h" | 23 #include "ash/wm/window_state.h" |
| 23 #include "ash/wm/window_state_aura.h" | 24 #include "ash/wm/window_state_aura.h" |
| 24 #include "base/i18n/rtl.h" | 25 #include "base/i18n/rtl.h" |
| 25 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
| 26 #include "ui/aura/client/aura_constants.h" | 27 #include "ui/aura/client/aura_constants.h" |
| 27 #include "ui/aura/window_event_dispatcher.h" | 28 #include "ui/aura/window_event_dispatcher.h" |
| 28 #include "ui/base/hit_test.h" | 29 #include "ui/base/hit_test.h" |
| 29 #include "ui/base/ui_base_types.h" | 30 #include "ui/base/ui_base_types.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 59 | 60 |
| 60 aura::Window* CreatePanelWindow(const gfx::Point& origin) { | 61 aura::Window* CreatePanelWindow(const gfx::Point& origin) { |
| 61 gfx::Rect bounds(origin, gfx::Size(101, 101)); | 62 gfx::Rect bounds(origin, gfx::Size(101, 101)); |
| 62 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( | 63 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
| 63 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); | 64 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); |
| 64 shelf_delegate_->AddShelfItem(window); | 65 shelf_delegate_->AddShelfItem(window); |
| 65 return window; | 66 return window; |
| 66 } | 67 } |
| 67 | 68 |
| 68 void DragStart(aura::Window* window) { | 69 void DragStart(aura::Window* window) { |
| 69 resizer_.reset(CreateWindowResizer( | 70 resizer_.reset(CreateWindowResizer(wm::WmWindowAura::Get(window), |
| 70 window, | 71 window->bounds().origin(), HTCAPTION, |
| 71 window->bounds().origin(), | 72 aura::client::WINDOW_MOVE_SOURCE_MOUSE) |
| 72 HTCAPTION, | 73 .release()); |
| 73 aura::client::WINDOW_MOVE_SOURCE_MOUSE).release()); | |
| 74 ASSERT_TRUE(resizer_.get()); | 74 ASSERT_TRUE(resizer_.get()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void DragMove(int dx, int dy) { | 77 void DragMove(int dx, int dy) { |
| 78 resizer_->Drag(CalculateDragPoint(*resizer_, dx, dy), 0); | 78 resizer_->Drag(CalculateDragPoint(*resizer_, dx, dy), 0); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void DragEnd() { | 81 void DragEnd() { |
| 82 resizer_->CompleteDrag(); | 82 resizer_->CompleteDrag(); |
| 83 resizer_.reset(); | 83 resizer_.reset(); |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 562 |
| 563 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, | 563 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, |
| 564 testing::Bool()); | 564 testing::Bool()); |
| 565 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 565 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
| 566 PanelWindowResizerTransientTest, | 566 PanelWindowResizerTransientTest, |
| 567 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 567 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 568 ui::wm::WINDOW_TYPE_PANEL, | 568 ui::wm::WINDOW_TYPE_PANEL, |
| 569 ui::wm::WINDOW_TYPE_POPUP)); | 569 ui::wm::WINDOW_TYPE_POPUP)); |
| 570 | 570 |
| 571 } // namespace ash | 571 } // namespace ash |
| OLD | NEW |