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

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

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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 (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 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 426
427 std::vector<ui::LayerAnimationSequence*> animations; 427 std::vector<ui::LayerAnimationSequence*> animations;
428 animations.push_back(brightness_sequence.release()); 428 animations.push_back(brightness_sequence.release());
429 animations.push_back(grayscale_sequence.release()); 429 animations.push_back(grayscale_sequence.release());
430 430
431 return animations; 431 return animations;
432 } 432 }
433 433
434 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { 434 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) {
435 WmWindow* wm_window = WmWindow::Get(window); 435 WmWindow* wm_window = WmWindow::Get(window);
436 WmShelf* shelf = WmShelf::ForWindow(wm_window); 436 WmShelf* shelf = WmShelf::ForWindow(window);
437 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(wm_window); 437 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(wm_window);
438 438
439 // The launcher item is visible and has an icon. 439 // The launcher item is visible and has an icon.
440 if (!item_rect.IsEmpty()) 440 if (!item_rect.IsEmpty())
441 return item_rect; 441 return item_rect;
442 442
443 // If both the icon width and height are 0, then there is no icon in the 443 // If both the icon width and height are 0, then there is no icon in the
444 // launcher for |window|. If the launcher is auto hidden, one of the height or 444 // launcher for |window|. If the launcher is auto hidden, one of the height or
445 // width will be 0 but the position in the launcher and the major dimension 445 // width will be 0 but the position in the launcher and the major dimension
446 // are still reported correctly and the window can be animated to the launcher 446 // are still reported correctly and the window can be animated to the launcher
(...skipping 24 matching lines...) Expand all
471 case SHELF_ALIGNMENT_LEFT: 471 case SHELF_ALIGNMENT_LEFT:
472 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); 472 return gfx::Rect(work_area.x(), work_area.y(), 0, 0);
473 case SHELF_ALIGNMENT_RIGHT: 473 case SHELF_ALIGNMENT_RIGHT:
474 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); 474 return gfx::Rect(work_area.right(), work_area.y(), 0, 0);
475 } 475 }
476 NOTREACHED(); 476 NOTREACHED();
477 return gfx::Rect(); 477 return gfx::Rect();
478 } 478 }
479 479
480 } // namespace ash 480 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/system_modal_container_layout_manager_unittest.cc ('k') | ash/wm/window_cycle_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698