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

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: rebase 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
« no previous file with comments | « ash/wm/drag_window_resizer.cc ('k') | ash/wm/window_animations.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 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::Rect bounds_in_screen = window->layer()->bounds();
203 window->parent(), window->layer()->bounds())); 203 ::wm::ConvertRectToScreen(window->parent(), &bounds_in_screen);
204 gfx::RectF bounds(bounds_in_screen);
204 gfx::Transform transform(gfx::TransformAboutPivot( 205 gfx::Transform transform(gfx::TransformAboutPivot(
205 gfx::ToFlooredPoint(bounds.origin()), window->layer()->transform())); 206 gfx::ToFlooredPoint(bounds.origin()), window->layer()->transform()));
206 transform.TransformRect(&bounds); 207 transform.TransformRect(&bounds);
207 return gfx::ToEnclosingRect(bounds); 208 return gfx::ToEnclosingRect(bounds);
208 } 209 }
209 210
210 gfx::Rect GetTransformedTargetBounds(aura::Window* window) { 211 gfx::Rect GetTransformedTargetBounds(aura::Window* window) {
211 gfx::RectF bounds(ScreenUtil::ConvertRectToScreen( 212 gfx::Rect bounds_in_screen = window->layer()->GetTargetBounds();
212 window->parent(), window->layer()->GetTargetBounds())); 213 ::wm::ConvertRectToScreen(window->parent(), &bounds_in_screen);
214 gfx::RectF bounds(bounds_in_screen);
213 gfx::Transform transform( 215 gfx::Transform transform(
214 gfx::TransformAboutPivot(gfx::ToFlooredPoint(bounds.origin()), 216 gfx::TransformAboutPivot(gfx::ToFlooredPoint(bounds.origin()),
215 window->layer()->GetTargetTransform())); 217 window->layer()->GetTargetTransform()));
216 transform.TransformRect(&bounds); 218 transform.TransformRect(&bounds);
217 return gfx::ToEnclosingRect(bounds); 219 return gfx::ToEnclosingRect(bounds);
218 } 220 }
219 221
220 gfx::Rect GetTransformedBoundsInRootWindow(aura::Window* window) { 222 gfx::Rect GetTransformedBoundsInRootWindow(aura::Window* window) {
221 gfx::RectF bounds = gfx::RectF(gfx::SizeF(window->bounds().size())); 223 gfx::RectF bounds = gfx::RectF(gfx::SizeF(window->bounds().size()));
222 aura::Window* root = window->GetRootWindow(); 224 aura::Window* root = window->GetRootWindow();
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 2129 aura::client::WINDOW_MOVE_SOURCE_MOUSE));
2128 ASSERT_TRUE(resizer.get()); 2130 ASSERT_TRUE(resizer.get());
2129 gfx::Point location = resizer->GetInitialLocation(); 2131 gfx::Point location = resizer->GetInitialLocation();
2130 location.Offset(20, 20); 2132 location.Offset(20, 20);
2131 resizer->Drag(location, 0); 2133 resizer->Drag(location, 0);
2132 ToggleOverview(); 2134 ToggleOverview();
2133 resizer->RevertDrag(); 2135 resizer->RevertDrag();
2134 } 2136 }
2135 2137
2136 } // namespace ash 2138 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/drag_window_resizer.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698