Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: ash/wm/workspace/workspace_window_resizer_unittest.cc

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
13 #include "ash/test/ash_test_base.h" 13 #include "ash/test/ash_test_base.h"
14 #include "ash/test/display_manager_test_api.h" 14 #include "ash/test/display_manager_test_api.h"
15 #include "ash/wm/common/wm_event.h" 15 #include "ash/wm/common/wm_event.h"
16 #include "ash/wm/window_state.h" 16 #include "ash/wm/window_state.h"
17 #include "ash/wm/window_state_aura.h"
17 #include "ash/wm/window_util.h" 18 #include "ash/wm/window_util.h"
18 #include "ash/wm/workspace/phantom_window_controller.h" 19 #include "ash/wm/workspace/phantom_window_controller.h"
19 #include "ash/wm/workspace_controller.h" 20 #include "ash/wm/workspace_controller.h"
20 #include "base/command_line.h" 21 #include "base/command_line.h"
21 #include "base/strings/string_number_conversions.h" 22 #include "base/strings/string_number_conversions.h"
22 #include "base/strings/stringprintf.h" 23 #include "base/strings/stringprintf.h"
23 #include "ui/aura/client/aura_constants.h" 24 #include "ui/aura/client/aura_constants.h"
24 #include "ui/aura/test/test_window_delegate.h" 25 #include "ui/aura/test/test_window_delegate.h"
25 #include "ui/aura/window_event_dispatcher.h" 26 #include "ui/aura/window_event_dispatcher.h"
26 #include "ui/base/hit_test.h" 27 #include "ui/base/hit_test.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 workspace_resizer_ = WorkspaceWindowResizer::GetInstanceForTest(); 151 workspace_resizer_ = WorkspaceWindowResizer::GetInstanceForTest();
151 return resizer; 152 return resizer;
152 } 153 }
153 WorkspaceWindowResizer* CreateWorkspaceResizerForTest( 154 WorkspaceWindowResizer* CreateWorkspaceResizerForTest(
154 aura::Window* window, 155 aura::Window* window,
155 const gfx::Point& point_in_parent, 156 const gfx::Point& point_in_parent,
156 int window_component, 157 int window_component,
157 aura::client::WindowMoveSource source, 158 aura::client::WindowMoveSource source,
158 const std::vector<aura::Window*>& attached_windows) { 159 const std::vector<aura::Window*>& attached_windows) {
159 wm::WindowState* window_state = wm::GetWindowState(window); 160 wm::WindowState* window_state = wm::GetWindowState(window);
160 window_state->CreateDragDetails( 161 window_state->CreateDragDetails(point_in_parent, window_component, source);
161 window, point_in_parent, window_component, source);
162 return WorkspaceWindowResizer::Create(window_state, attached_windows); 162 return WorkspaceWindowResizer::Create(window_state, attached_windows);
163 } 163 }
164 164
165 PhantomWindowController* snap_phantom_window_controller() const { 165 PhantomWindowController* snap_phantom_window_controller() const {
166 return workspace_resizer_->snap_phantom_window_controller_.get(); 166 return workspace_resizer_->snap_phantom_window_controller_.get();
167 } 167 }
168 168
169 gfx::Point CalculateDragPoint(const WindowResizer& resizer, 169 gfx::Point CalculateDragPoint(const WindowResizer& resizer,
170 int delta_x, 170 int delta_x,
171 int delta_y) const { 171 int delta_y) const {
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 // Drag even more to snap to the edge. 1885 // Drag even more to snap to the edge.
1886 generator.GestureScrollSequence(gfx::Point(400, kRootHeight - 40), 1886 generator.GestureScrollSequence(gfx::Point(400, kRootHeight - 40),
1887 gfx::Point(400, kRootHeight - 25), 1887 gfx::Point(400, kRootHeight - 25),
1888 base::TimeDelta::FromMilliseconds(10), 1888 base::TimeDelta::FromMilliseconds(10),
1889 5); 1889 5);
1890 EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 100).ToString(), 1890 EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 100).ToString(),
1891 touch_resize_window_->bounds().ToString()); 1891 touch_resize_window_->bounds().ToString());
1892 } 1892 }
1893 1893
1894 } // namespace ash 1894 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698