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

Side by Side Diff: ash/wm/window_animations.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 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/toplevel_window_event_handler_unittest.cc ('k') | ash/wm/window_manager_unittest.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/window_animations.h" 5 #include "ash/wm/window_animations.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); 391 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET);
392 } 392 }
393 393
394 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { 394 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) {
395 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> 395 gfx::Rect target_bounds = Shell::GetInstance()->launcher()->
396 GetScreenBoundsOfItemIconForWindow(window); 396 GetScreenBoundsOfItemIconForWindow(window);
397 if (target_bounds.IsEmpty()) { 397 if (target_bounds.IsEmpty()) {
398 // Assume the launcher is overflowed, zoom off to the bottom right of the 398 // Assume the launcher is overflowed, zoom off to the bottom right of the
399 // work area. 399 // work area.
400 gfx::Rect work_area = 400 gfx::Rect work_area =
401 gfx::Screen::GetDisplayNearestWindow(window).work_area(); 401 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area();
402 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); 402 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0);
403 } 403 }
404 target_bounds = 404 target_bounds =
405 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds); 405 ScreenAsh::ConvertRectFromScreen(window->parent(), target_bounds);
406 return target_bounds; 406 return target_bounds;
407 } 407 }
408 408
409 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { 409 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) {
410 // Recalculate the transform at restore time since the launcher item may have 410 // Recalculate the transform at restore time since the launcher item may have
411 // moved while the window was minimized. 411 // moved while the window was minimized.
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 return AnimateShowWindow(window); 1164 return AnimateShowWindow(window);
1165 } else { 1165 } else {
1166 // Don't start hiding the window again if it's already being hidden. 1166 // Don't start hiding the window again if it's already being hidden.
1167 return window->layer()->GetTargetOpacity() != 0.0f && 1167 return window->layer()->GetTargetOpacity() != 0.0f &&
1168 AnimateHideWindow(window); 1168 AnimateHideWindow(window);
1169 } 1169 }
1170 } 1170 }
1171 1171
1172 } // namespace internal 1172 } // namespace internal
1173 } // namespace ash 1173 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/toplevel_window_event_handler_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698