| 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> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
| 27 #include "ui/aura/window_observer.h" | 27 #include "ui/aura/window_observer.h" |
| 28 #include "ui/aura/window_property.h" | 28 #include "ui/aura/window_property.h" |
| 29 #include "ui/compositor/compositor_observer.h" | 29 #include "ui/compositor/compositor_observer.h" |
| 30 #include "ui/compositor/layer.h" | 30 #include "ui/compositor/layer.h" |
| 31 #include "ui/compositor/layer_animation_observer.h" | 31 #include "ui/compositor/layer_animation_observer.h" |
| 32 #include "ui/compositor/layer_animation_sequence.h" | 32 #include "ui/compositor/layer_animation_sequence.h" |
| 33 #include "ui/compositor/layer_animator.h" | 33 #include "ui/compositor/layer_animator.h" |
| 34 #include "ui/compositor/layer_tree_owner.h" | 34 #include "ui/compositor/layer_tree_owner.h" |
| 35 #include "ui/compositor/scoped_layer_animation_settings.h" | 35 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 36 #include "ui/display/screen.h" |
| 36 #include "ui/gfx/geometry/vector3d_f.h" | 37 #include "ui/gfx/geometry/vector3d_f.h" |
| 37 #include "ui/gfx/interpolated_transform.h" | 38 #include "ui/gfx/interpolated_transform.h" |
| 38 #include "ui/gfx/screen.h" | |
| 39 #include "ui/views/view.h" | 39 #include "ui/views/view.h" |
| 40 #include "ui/views/widget/widget.h" | 40 #include "ui/views/widget/widget.h" |
| 41 #include "ui/wm/core/window_util.h" | 41 #include "ui/wm/core/window_util.h" |
| 42 | 42 |
| 43 namespace ash { | 43 namespace ash { |
| 44 namespace { | 44 namespace { |
| 45 const int kLayerAnimationsForMinimizeDurationMS = 200; | 45 const int kLayerAnimationsForMinimizeDurationMS = 200; |
| 46 | 46 |
| 47 // Durations for the cross-fade animation, in milliseconds. | 47 // Durations for the cross-fade animation, in milliseconds. |
| 48 const float kCrossFadeDurationMinMs = 200.f; | 48 const float kCrossFadeDurationMinMs = 200.f; |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 else | 476 else |
| 477 item_rect.set_y(shelf_bounds.y()); | 477 item_rect.set_y(shelf_bounds.y()); |
| 478 return item_rect; | 478 return item_rect; |
| 479 } | 479 } |
| 480 } | 480 } |
| 481 | 481 |
| 482 // Coming here, there is no visible icon of that shelf item and we zoom back | 482 // Coming here, there is no visible icon of that shelf item and we zoom back |
| 483 // to the location of the application launcher (which is fixed as first item | 483 // to the location of the application launcher (which is fixed as first item |
| 484 // of the shelf). | 484 // of the shelf). |
| 485 gfx::Rect work_area = | 485 gfx::Rect work_area = |
| 486 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 486 display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
| 487 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); | 487 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); |
| 488 return shelf->SelectValueForShelfAlignment( | 488 return shelf->SelectValueForShelfAlignment( |
| 489 gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0), | 489 gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0), |
| 490 gfx::Rect(work_area.x(), work_area.y(), 0, 0), | 490 gfx::Rect(work_area.x(), work_area.y(), 0, 0), |
| 491 gfx::Rect(work_area.right(), work_area.y(), 0, 0)); | 491 gfx::Rect(work_area.right(), work_area.y(), 0, 0)); |
| 492 } | 492 } |
| 493 | 493 |
| 494 } // namespace ash | 494 } // namespace ash |
| OLD | NEW |