OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ui/aura/test/event_generator.h" | 25 #include "ui/aura/test/event_generator.h" |
26 #include "ui/aura/test/test_window_delegate.h" | 26 #include "ui/aura/test/test_window_delegate.h" |
27 #include "ui/aura/window_event_dispatcher.h" | 27 #include "ui/aura/window_event_dispatcher.h" |
28 #include "ui/base/hit_test.h" | 28 #include "ui/base/hit_test.h" |
29 #include "ui/events/gestures/gesture_configuration.h" | 29 #include "ui/events/gestures/gesture_configuration.h" |
30 #include "ui/gfx/insets.h" | 30 #include "ui/gfx/insets.h" |
31 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
32 #include "ui/views/widget/widget.h" | 32 #include "ui/views/widget/widget.h" |
33 | 33 |
34 namespace ash { | 34 namespace ash { |
35 namespace internal { | |
36 namespace { | 35 namespace { |
37 | 36 |
38 const int kRootHeight = 600; | 37 const int kRootHeight = 600; |
39 | 38 |
40 // A simple window delegate that returns the specified min size. | 39 // A simple window delegate that returns the specified min size. |
41 class TestWindowDelegate : public aura::test::TestWindowDelegate { | 40 class TestWindowDelegate : public aura::test::TestWindowDelegate { |
42 public: | 41 public: |
43 TestWindowDelegate() { | 42 TestWindowDelegate() { |
44 } | 43 } |
45 virtual ~TestWindowDelegate() {} | 44 virtual ~TestWindowDelegate() {} |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 gfx::Point location = resizer.GetInitialLocation(); | 175 gfx::Point location = resizer.GetInitialLocation(); |
177 location.set_x(location.x() + delta_x); | 176 location.set_x(location.x() + delta_x); |
178 location.set_y(location.y() + delta_y); | 177 location.set_y(location.y() + delta_y); |
179 return location; | 178 return location; |
180 } | 179 } |
181 | 180 |
182 std::vector<aura::Window*> empty_windows() const { | 181 std::vector<aura::Window*> empty_windows() const { |
183 return std::vector<aura::Window*>(); | 182 return std::vector<aura::Window*>(); |
184 } | 183 } |
185 | 184 |
186 internal::ShelfLayoutManager* shelf_layout_manager() { | 185 ShelfLayoutManager* shelf_layout_manager() { |
187 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); | 186 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); |
188 } | 187 } |
189 | 188 |
190 void InitTouchResizeWindow(const gfx::Rect& bounds, int window_component) { | 189 void InitTouchResizeWindow(const gfx::Rect& bounds, int window_component) { |
191 touch_resize_delegate_.set_window_component(window_component); | 190 touch_resize_delegate_.set_window_component(window_component); |
192 touch_resize_window_.reset( | 191 touch_resize_window_.reset( |
193 CreateTestWindowInShellWithDelegate(&touch_resize_delegate_, 0, | 192 CreateTestWindowInShellWithDelegate(&touch_resize_delegate_, 0, |
194 bounds)); | 193 bounds)); |
195 } | 194 } |
196 | 195 |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1867 touch_resize_window_->bounds().ToString()); | 1866 touch_resize_window_->bounds().ToString()); |
1868 // Drag even more to snap to the edge. | 1867 // Drag even more to snap to the edge. |
1869 generator.GestureScrollSequence(gfx::Point(400, kRootHeight - 40), | 1868 generator.GestureScrollSequence(gfx::Point(400, kRootHeight - 40), |
1870 gfx::Point(400, kRootHeight - 25), | 1869 gfx::Point(400, kRootHeight - 25), |
1871 base::TimeDelta::FromMilliseconds(10), | 1870 base::TimeDelta::FromMilliseconds(10), |
1872 5); | 1871 5); |
1873 EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 100).ToString(), | 1872 EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 100).ToString(), |
1874 touch_resize_window_->bounds().ToString()); | 1873 touch_resize_window_->bounds().ToString()); |
1875 } | 1874 } |
1876 | 1875 |
1877 } // namespace internal | |
1878 } // namespace ash | 1876 } // namespace ash |
OLD | NEW |