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

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

Issue 138003007: [Cleanup] Screen cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make sure screen_for_shutdown is reset everytime Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/overview/window_selector_panels.cc ('k') | ash/wm/panels/panel_layout_manager.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 "ash/root_window_controller.h" 5 #include "ash/root_window_controller.h"
6 #include "ash/screen_ash.h" 6 #include "ash/screen_util.h"
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/shelf/shelf_widget.h" 8 #include "ash/shelf/shelf_widget.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
11 #include "ash/test/shelf_test_api.h" 11 #include "ash/test/shelf_test_api.h"
12 #include "ash/test/shelf_view_test_api.h" 12 #include "ash/test/shelf_view_test_api.h"
13 #include "ash/test/shell_test_api.h" 13 #include "ash/test/shell_test_api.h"
14 #include "ash/test/test_shelf_delegate.h" 14 #include "ash/test/test_shelf_delegate.h"
15 #include "ash/wm/mru_window_tracker.h" 15 #include "ash/wm/mru_window_tracker.h"
16 #include "ash/wm/overview/window_selector.h" 16 #include "ash/wm/overview/window_selector.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 gfx::Transform GetTransformRelativeTo(gfx::PointF origin, 165 gfx::Transform GetTransformRelativeTo(gfx::PointF origin,
166 const gfx::Transform& transform) { 166 const gfx::Transform& transform) {
167 gfx::Transform t; 167 gfx::Transform t;
168 t.Translate(origin.x(), origin.y()); 168 t.Translate(origin.x(), origin.y());
169 t.PreconcatTransform(transform); 169 t.PreconcatTransform(transform);
170 t.Translate(-origin.x(), -origin.y()); 170 t.Translate(-origin.x(), -origin.y());
171 return t; 171 return t;
172 } 172 }
173 173
174 gfx::RectF GetTransformedBounds(aura::Window* window) { 174 gfx::RectF GetTransformedBounds(aura::Window* window) {
175 gfx::RectF bounds(ash::ScreenAsh::ConvertRectToScreen( 175 gfx::RectF bounds(ScreenUtil::ConvertRectToScreen(
176 window->parent(), window->layer()->bounds())); 176 window->parent(), window->layer()->bounds()));
177 gfx::Transform transform(GetTransformRelativeTo(bounds.origin(), 177 gfx::Transform transform(GetTransformRelativeTo(bounds.origin(),
178 window->layer()->transform())); 178 window->layer()->transform()));
179 transform.TransformRect(&bounds); 179 transform.TransformRect(&bounds);
180 return bounds; 180 return bounds;
181 } 181 }
182 182
183 gfx::RectF GetTransformedTargetBounds(aura::Window* window) { 183 gfx::RectF GetTransformedTargetBounds(aura::Window* window) {
184 gfx::RectF bounds(ash::ScreenAsh::ConvertRectToScreen( 184 gfx::RectF bounds(ScreenUtil::ConvertRectToScreen(
185 window->parent(), window->layer()->GetTargetBounds())); 185 window->parent(), window->layer()->GetTargetBounds()));
186 gfx::Transform transform(GetTransformRelativeTo(bounds.origin(), 186 gfx::Transform transform(GetTransformRelativeTo(bounds.origin(),
187 window->layer()->GetTargetTransform())); 187 window->layer()->GetTargetTransform()));
188 transform.TransformRect(&bounds); 188 transform.TransformRect(&bounds);
189 return bounds; 189 return bounds;
190 } 190 }
191 191
192 void ClickWindow(aura::Window* window) { 192 void ClickWindow(aura::Window* window) {
193 aura::test::EventGenerator event_generator(window->GetRootWindow(), window); 193 aura::test::EventGenerator event_generator(window->GetRootWindow(), window);
194 gfx::RectF target = GetTransformedBounds(window); 194 gfx::RectF target = GetTransformedBounds(window);
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 wm::ActivateWindow(window1.get()); 990 wm::ActivateWindow(window1.get());
991 991
992 ToggleOverview(); 992 ToggleOverview();
993 EXPECT_TRUE(IsSelecting()); 993 EXPECT_TRUE(IsSelecting());
994 UpdateDisplay("400x400"); 994 UpdateDisplay("400x400");
995 EXPECT_FALSE(IsSelecting()); 995 EXPECT_FALSE(IsSelecting());
996 } 996 }
997 997
998 } // namespace internal 998 } // namespace internal
999 } // namespace ash 999 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector_panels.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698