| 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" | |
| 13 #include "ash/common/shelf/wm_shelf.h" | 12 #include "ash/common/shelf/wm_shelf.h" |
| 14 #include "ash/common/wm/window_animation_types.h" | 13 #include "ash/common/wm/window_animation_types.h" |
| 15 #include "ash/common/wm/workspace_controller.h" | 14 #include "ash/common/wm/workspace_controller.h" |
| 15 #include "ash/common/wm_window.h" |
| 16 #include "ash/screen_util.h" | 16 #include "ash/screen_util.h" |
| 17 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
| 18 #include "base/i18n/rtl.h" | 18 #include "base/i18n/rtl.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
| 21 #include "base/stl_util.h" | 21 #include "base/stl_util.h" |
| 22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 23 #include "ui/aura/client/aura_constants.h" | 23 #include "ui/aura/client/aura_constants.h" |
| 24 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
| 25 #include "ui/aura/window_observer.h" | 25 #include "ui/aura/window_observer.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 grayscale_sequence->AddElement(std::move(grayscale_element)); | 406 grayscale_sequence->AddElement(std::move(grayscale_element)); |
| 407 | 407 |
| 408 std::vector<ui::LayerAnimationSequence*> animations; | 408 std::vector<ui::LayerAnimationSequence*> animations; |
| 409 animations.push_back(brightness_sequence.release()); | 409 animations.push_back(brightness_sequence.release()); |
| 410 animations.push_back(grayscale_sequence.release()); | 410 animations.push_back(grayscale_sequence.release()); |
| 411 | 411 |
| 412 return animations; | 412 return animations; |
| 413 } | 413 } |
| 414 | 414 |
| 415 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { | 415 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { |
| 416 WmWindow* wm_window = WmWindowAura::Get(window); | 416 WmWindow* wm_window = WmWindow::Get(window); |
| 417 WmShelf* shelf = WmShelf::ForWindow(wm_window); | 417 WmShelf* shelf = WmShelf::ForWindow(wm_window); |
| 418 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(wm_window); | 418 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(wm_window); |
| 419 | 419 |
| 420 // The launcher item is visible and has an icon. | 420 // The launcher item is visible and has an icon. |
| 421 if (!item_rect.IsEmpty()) | 421 if (!item_rect.IsEmpty()) |
| 422 return item_rect; | 422 return item_rect; |
| 423 | 423 |
| 424 // If both the icon width and height are 0, then there is no icon in the | 424 // If both the icon width and height are 0, then there is no icon in the |
| 425 // launcher for |window|. If the launcher is auto hidden, one of the height or | 425 // launcher for |window|. If the launcher is auto hidden, one of the height or |
| 426 // width will be 0 but the position in the launcher and the major dimension | 426 // width will be 0 but the position in the launcher and the major dimension |
| (...skipping 25 matching lines...) Expand all Loading... |
| 452 case SHELF_ALIGNMENT_LEFT: | 452 case SHELF_ALIGNMENT_LEFT: |
| 453 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); | 453 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); |
| 454 case SHELF_ALIGNMENT_RIGHT: | 454 case SHELF_ALIGNMENT_RIGHT: |
| 455 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); | 455 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); |
| 456 } | 456 } |
| 457 NOTREACHED(); | 457 NOTREACHED(); |
| 458 return gfx::Rect(); | 458 return gfx::Rect(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 } // namespace ash | 461 } // namespace ash |
| OLD | NEW |