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" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( | 64 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
65 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); | 65 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); |
66 static int id = 0; | 66 static int id = 0; |
67 std::string shelf_id(ash::ShelfID(base::IntToString(id++)).Serialize()); | 67 std::string shelf_id(ash::ShelfID(base::IntToString(id++)).Serialize()); |
68 window->SetProperty(kShelfIDKey, new std::string(shelf_id)); | 68 window->SetProperty(kShelfIDKey, new std::string(shelf_id)); |
69 shelf_view_test_->RunMessageLoopUntilAnimationsDone(); | 69 shelf_view_test_->RunMessageLoopUntilAnimationsDone(); |
70 return window; | 70 return window; |
71 } | 71 } |
72 | 72 |
73 void DragStart(aura::Window* window) { | 73 void DragStart(aura::Window* window) { |
74 resizer_ = | 74 resizer_ = CreateWindowResizer(window, window->bounds().origin(), HTCAPTION, |
75 CreateWindowResizer(WmWindow::Get(window), window->bounds().origin(), | 75 aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
76 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE); | |
77 } | 76 } |
78 | 77 |
79 void DragMove(int dx, int dy) { | 78 void DragMove(int dx, int dy) { |
80 resizer_->Drag(CalculateDragPoint(*resizer_, dx, dy), 0); | 79 resizer_->Drag(CalculateDragPoint(*resizer_, dx, dy), 0); |
81 } | 80 } |
82 | 81 |
83 void DragEnd() { | 82 void DragEnd() { |
84 resizer_->CompleteDrag(); | 83 resizer_->CompleteDrag(); |
85 resizer_.reset(); | 84 resizer_.reset(); |
86 } | 85 } |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 | 558 |
560 INSTANTIATE_TEST_CASE_P(LtrRtl, | 559 INSTANTIATE_TEST_CASE_P(LtrRtl, |
561 PanelWindowResizerTextDirectionTest, | 560 PanelWindowResizerTextDirectionTest, |
562 testing::Bool()); | 561 testing::Bool()); |
563 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 562 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
564 PanelWindowResizerTransientTest, | 563 PanelWindowResizerTransientTest, |
565 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 564 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
566 ui::wm::WINDOW_TYPE_POPUP)); | 565 ui::wm::WINDOW_TYPE_POPUP)); |
567 | 566 |
568 } // namespace ash | 567 } // namespace ash |
OLD | NEW |