| OLD | NEW |
| 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> |
| 11 | 11 |
| 12 #include "ash/aura/wm_window_aura.h" |
| 12 #include "ash/common/wm/window_animation_types.h" | 13 #include "ash/common/wm/window_animation_types.h" |
| 13 #include "ash/screen_util.h" | 14 #include "ash/screen_util.h" |
| 14 #include "ash/shelf/shelf.h" | 15 #include "ash/shelf/shelf.h" |
| 15 #include "ash/shelf/shelf_layout_manager.h" | 16 #include "ash/shelf/shelf_layout_manager.h" |
| 16 #include "ash/shelf/shelf_widget.h" | 17 #include "ash/shelf/shelf_widget.h" |
| 17 #include "ash/wm/window_util.h" | 18 #include "ash/wm/window_util.h" |
| 18 #include "ash/wm/workspace_controller.h" | 19 #include "ash/wm/workspace_controller.h" |
| 19 #include "base/command_line.h" | 20 #include "base/command_line.h" |
| 20 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
| 21 #include "base/logging.h" | 22 #include "base/logging.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 grayscale_sequence->AddElement(grayscale_element.release()); | 427 grayscale_sequence->AddElement(grayscale_element.release()); |
| 427 | 428 |
| 428 std::vector<ui::LayerAnimationSequence*> animations; | 429 std::vector<ui::LayerAnimationSequence*> animations; |
| 429 animations.push_back(brightness_sequence.release()); | 430 animations.push_back(brightness_sequence.release()); |
| 430 animations.push_back(grayscale_sequence.release()); | 431 animations.push_back(grayscale_sequence.release()); |
| 431 | 432 |
| 432 return animations; | 433 return animations; |
| 433 } | 434 } |
| 434 | 435 |
| 435 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { | 436 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { |
| 436 Shelf* shelf = Shelf::ForWindow(window); | 437 WmWindow* wm_window = WmWindowAura::Get(window); |
| 438 Shelf* shelf = Shelf::ForWindow(wm_window); |
| 437 // Shelf is created lazily and can be NULL. | 439 // Shelf is created lazily and can be NULL. |
| 438 if (!shelf) | 440 if (!shelf) |
| 439 return gfx::Rect(); | 441 return gfx::Rect(); |
| 440 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(window); | 442 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(wm_window); |
| 441 | 443 |
| 442 // The launcher item is visible and has an icon. | 444 // The launcher item is visible and has an icon. |
| 443 if (!item_rect.IsEmpty()) | 445 if (!item_rect.IsEmpty()) |
| 444 return item_rect; | 446 return item_rect; |
| 445 | 447 |
| 446 // If both the icon width and height are 0, then there is no icon in the | 448 // If both the icon width and height are 0, then there is no icon in the |
| 447 // launcher for |window|. If the launcher is auto hidden, one of the height or | 449 // launcher for |window|. If the launcher is auto hidden, one of the height or |
| 448 // width will be 0 but the position in the launcher and the major dimension | 450 // width will be 0 but the position in the launcher and the major dimension |
| 449 // are still reported correctly and the window can be animated to the launcher | 451 // are still reported correctly and the window can be animated to the launcher |
| 450 // item's light bar. | 452 // item's light bar. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 474 case SHELF_ALIGNMENT_LEFT: | 476 case SHELF_ALIGNMENT_LEFT: |
| 475 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); | 477 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); |
| 476 case SHELF_ALIGNMENT_RIGHT: | 478 case SHELF_ALIGNMENT_RIGHT: |
| 477 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); | 479 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); |
| 478 } | 480 } |
| 479 NOTREACHED(); | 481 NOTREACHED(); |
| 480 return gfx::Rect(); | 482 return gfx::Rect(); |
| 481 } | 483 } |
| 482 | 484 |
| 483 } // namespace ash | 485 } // namespace ash |
| OLD | NEW |