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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2660873002: Move two utility functions from ash/screen_util.h to ui/wm/core/coordinate_conversion.h (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/common/accessibility_delegate.h" 8 #include "ash/common/accessibility_delegate.h"
9 #include "ash/common/accessibility_types.h" 9 #include "ash/common/accessibility_types.h"
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 13 matching lines...) Expand all
24 #include "ash/common/wm/window_state.h" 24 #include "ash/common/wm/window_state.h"
25 #include "ash/common/wm/wm_event.h" 25 #include "ash/common/wm/wm_event.h"
26 #include "ash/common/wm/workspace/workspace_window_resizer.h" 26 #include "ash/common/wm/workspace/workspace_window_resizer.h"
27 #include "ash/common/wm_lookup.h" 27 #include "ash/common/wm_lookup.h"
28 #include "ash/common/wm_shell.h" 28 #include "ash/common/wm_shell.h"
29 #include "ash/common/wm_window.h" 29 #include "ash/common/wm_window.h"
30 #include "ash/common/wm_window_property.h" 30 #include "ash/common/wm_window_property.h"
31 #include "ash/drag_drop/drag_drop_controller.h" 31 #include "ash/drag_drop/drag_drop_controller.h"
32 #include "ash/public/cpp/shell_window_ids.h" 32 #include "ash/public/cpp/shell_window_ids.h"
33 #include "ash/root_window_controller.h" 33 #include "ash/root_window_controller.h"
34 #include "ash/screen_util.h"
35 #include "ash/shell.h" 34 #include "ash/shell.h"
36 #include "ash/test/ash_test_base.h" 35 #include "ash/test/ash_test_base.h"
37 #include "ash/test/shelf_view_test_api.h" 36 #include "ash/test/shelf_view_test_api.h"
38 #include "ash/test/shell_test_api.h" 37 #include "ash/test/shell_test_api.h"
39 #include "ash/test/test_app_list_view_presenter_impl.h" 38 #include "ash/test/test_app_list_view_presenter_impl.h"
40 #include "ash/wm/window_state_aura.h" 39 #include "ash/wm/window_state_aura.h"
41 #include "ash/wm/window_util.h" 40 #include "ash/wm/window_util.h"
42 #include "base/command_line.h" 41 #include "base/command_line.h"
43 #include "base/compiler_specific.h" 42 #include "base/compiler_specific.h"
44 #include "base/memory/ptr_util.h" 43 #include "base/memory/ptr_util.h"
(...skipping 19 matching lines...) Expand all
64 #include "ui/gfx/animation/slide_animation.h" 63 #include "ui/gfx/animation/slide_animation.h"
65 #include "ui/gfx/geometry/point_conversions.h" 64 #include "ui/gfx/geometry/point_conversions.h"
66 #include "ui/gfx/geometry/rect_conversions.h" 65 #include "ui/gfx/geometry/rect_conversions.h"
67 #include "ui/gfx/geometry/safe_integer_conversions.h" 66 #include "ui/gfx/geometry/safe_integer_conversions.h"
68 #include "ui/gfx/transform.h" 67 #include "ui/gfx/transform.h"
69 #include "ui/gfx/transform_util.h" 68 #include "ui/gfx/transform_util.h"
70 #include "ui/views/controls/button/image_button.h" 69 #include "ui/views/controls/button/image_button.h"
71 #include "ui/views/controls/label.h" 70 #include "ui/views/controls/label.h"
72 #include "ui/views/widget/native_widget_aura.h" 71 #include "ui/views/widget/native_widget_aura.h"
73 #include "ui/views/widget/widget_delegate.h" 72 #include "ui/views/widget/widget_delegate.h"
73 #include "ui/wm/core/coordinate_conversion.h"
74 #include "ui/wm/core/window_util.h" 74 #include "ui/wm/core/window_util.h"
75 #include "ui/wm/public/activation_delegate.h" 75 #include "ui/wm/public/activation_delegate.h"
76 76
77 namespace ash { 77 namespace ash {
78 namespace { 78 namespace {
79 79
80 // The label covers selector item windows with a padding in order to prevent 80 // The label covers selector item windows with a padding in order to prevent
81 // them from receiving user input events while in overview. 81 // them from receiving user input events while in overview.
82 static const int kWindowMargin = 5; 82 static const int kWindowMargin = 5;
83 83
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void ToggleOverview() { window_selector_controller()->ToggleOverview(); } 192 void ToggleOverview() { window_selector_controller()->ToggleOverview(); }
193 193
194 aura::Window* GetOverviewWindowForMinimizedState(int index, 194 aura::Window* GetOverviewWindowForMinimizedState(int index,
195 aura::Window* window) { 195 aura::Window* window) {
196 WindowSelectorItem* selector = GetWindowItemForWindow(index, window); 196 WindowSelectorItem* selector = GetWindowItemForWindow(index, window);
197 return WmWindow::GetAuraWindow( 197 return WmWindow::GetAuraWindow(
198 selector->GetOverviewWindowForMinimizedStateForTest()); 198 selector->GetOverviewWindowForMinimizedStateForTest());
199 } 199 }
200 200
201 gfx::Rect GetTransformedBounds(aura::Window* window) { 201 gfx::Rect GetTransformedBounds(aura::Window* window) {
202 gfx::RectF bounds(ScreenUtil::ConvertRectToScreen( 202 gfx::RectF bounds(
203 window->parent(), window->layer()->bounds())); 203 ::wm::ConvertRectToScreen(window->parent(), window->layer()->bounds()));
204 gfx::Transform transform(gfx::TransformAboutPivot( 204 gfx::Transform transform(gfx::TransformAboutPivot(
205 gfx::ToFlooredPoint(bounds.origin()), window->layer()->transform())); 205 gfx::ToFlooredPoint(bounds.origin()), window->layer()->transform()));
206 transform.TransformRect(&bounds); 206 transform.TransformRect(&bounds);
207 return gfx::ToEnclosingRect(bounds); 207 return gfx::ToEnclosingRect(bounds);
208 } 208 }
209 209
210 gfx::Rect GetTransformedTargetBounds(aura::Window* window) { 210 gfx::Rect GetTransformedTargetBounds(aura::Window* window) {
211 gfx::RectF bounds(ScreenUtil::ConvertRectToScreen( 211 gfx::RectF bounds(::wm::ConvertRectToScreen(
212 window->parent(), window->layer()->GetTargetBounds())); 212 window->parent(), window->layer()->GetTargetBounds()));
213 gfx::Transform transform( 213 gfx::Transform transform(
214 gfx::TransformAboutPivot(gfx::ToFlooredPoint(bounds.origin()), 214 gfx::TransformAboutPivot(gfx::ToFlooredPoint(bounds.origin()),
215 window->layer()->GetTargetTransform())); 215 window->layer()->GetTargetTransform()));
216 transform.TransformRect(&bounds); 216 transform.TransformRect(&bounds);
217 return gfx::ToEnclosingRect(bounds); 217 return gfx::ToEnclosingRect(bounds);
218 } 218 }
219 219
220 gfx::Rect GetTransformedBoundsInRootWindow(aura::Window* window) { 220 gfx::Rect GetTransformedBoundsInRootWindow(aura::Window* window) {
221 gfx::RectF bounds = gfx::RectF(gfx::SizeF(window->bounds().size())); 221 gfx::RectF bounds = gfx::RectF(gfx::SizeF(window->bounds().size()));
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 2126 aura::client::WINDOW_MOVE_SOURCE_MOUSE));
2127 ASSERT_TRUE(resizer.get()); 2127 ASSERT_TRUE(resizer.get());
2128 gfx::Point location = resizer->GetInitialLocation(); 2128 gfx::Point location = resizer->GetInitialLocation();
2129 location.Offset(20, 20); 2129 location.Offset(20, 20);
2130 resizer->Drag(location, 0); 2130 resizer->Drag(location, 0);
2131 ToggleOverview(); 2131 ToggleOverview();
2132 resizer->RevertDrag(); 2132 resizer->RevertDrag();
2133 } 2133 }
2134 2134
2135 } // namespace ash 2135 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698