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

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

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/toplevel_window_event_filter_unittest.cc ('k') | ash/wm/window_resizer.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 "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/launcher/launcher.h" 8 #include "ash/launcher/launcher.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 animator->set_preemption_strategy( 339 animator->set_preemption_strategy(
340 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); 340 ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET);
341 } 341 }
342 342
343 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) { 343 gfx::Rect GetMinimizeRectForWindow(aura::Window* window) {
344 gfx::Rect target_bounds = Shell::GetInstance()->launcher()-> 344 gfx::Rect target_bounds = Shell::GetInstance()->launcher()->
345 GetScreenBoundsOfItemIconForWindow(window); 345 GetScreenBoundsOfItemIconForWindow(window);
346 if (target_bounds.IsEmpty()) { 346 if (target_bounds.IsEmpty()) {
347 // Assume the launcher is overflowed, zoom off to the bottom right of the 347 // Assume the launcher is overflowed, zoom off to the bottom right of the
348 // work area. 348 // work area.
349 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestWindow(window); 349 gfx::Rect work_area =
350 gfx::Screen::GetMonitorNearestWindow(window).work_area();
350 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0); 351 target_bounds.SetRect(work_area.right(), work_area.bottom(), 0, 0);
351 } 352 }
352 return target_bounds; 353 return target_bounds;
353 } 354 }
354 355
355 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) { 356 void AddLayerAnimationsForMinimize(aura::Window* window, bool show) {
356 // Recalculate the transform at restore time since the launcher item may have 357 // Recalculate the transform at restore time since the launcher item may have
357 // moved while the window was minimized. 358 // moved while the window was minimized.
358 gfx::Rect bounds = window->bounds(); 359 gfx::Rect bounds = window->bounds();
359 gfx::Rect target_bounds = GetMinimizeRectForWindow(window); 360 gfx::Rect target_bounds = GetMinimizeRectForWindow(window);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 } 496 }
496 497
497 } // namespace internal 498 } // namespace internal
498 499
499 ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( 500 ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver(
500 aura::Window* window) { 501 aura::Window* window) {
501 return new internal::HidingWindowAnimationObserver(window); 502 return new internal::HidingWindowAnimationObserver(window);
502 } 503 }
503 504
504 } // namespace ash 505 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/toplevel_window_event_filter_unittest.cc ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698