| 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/shelf/shelf_view.h" | 5 #include "ash/shelf/shelf_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/aura/wm_window_aura.h" | 10 #include "ash/aura/wm_window_aura.h" |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 FinalizeRipOffDrag(false); | 786 FinalizeRipOffDrag(false); |
| 787 drag_pointer_ = NONE; | 787 drag_pointer_ = NONE; |
| 788 AnimateToIdealBounds(); | 788 AnimateToIdealBounds(); |
| 789 } | 789 } |
| 790 // If the drag pointer is NONE, no drag operation is going on and the | 790 // If the drag pointer is NONE, no drag operation is going on and the |
| 791 // drag_view can be released. | 791 // drag_view can be released. |
| 792 if (drag_pointer_ == NONE) | 792 if (drag_pointer_ == NONE) |
| 793 drag_view_ = nullptr; | 793 drag_view_ = nullptr; |
| 794 } | 794 } |
| 795 | 795 |
| 796 void ShelfView::UpdateShelfItemBackground(int alpha) { |
| 797 GetAppListButton()->SetBackgroundAlpha(alpha); |
| 798 overflow_button_->SetBackgroundAlpha(alpha); |
| 799 } |
| 800 |
| 796 void ShelfView::LayoutToIdealBounds() { | 801 void ShelfView::LayoutToIdealBounds() { |
| 797 if (bounds_animator_->IsAnimating()) { | 802 if (bounds_animator_->IsAnimating()) { |
| 798 AnimateToIdealBounds(); | 803 AnimateToIdealBounds(); |
| 799 return; | 804 return; |
| 800 } | 805 } |
| 801 | 806 |
| 802 IdealBounds ideal_bounds; | 807 IdealBounds ideal_bounds; |
| 803 CalculateIdealBounds(&ideal_bounds); | 808 CalculateIdealBounds(&ideal_bounds); |
| 804 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); | 809 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); |
| 805 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds); | 810 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds); |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1907 | 1912 |
| 1908 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1913 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
| 1909 const gfx::Rect bounds = GetBoundsInScreen(); | 1914 const gfx::Rect bounds = GetBoundsInScreen(); |
| 1910 int distance = shelf_->SelectValueForShelfAlignment( | 1915 int distance = shelf_->SelectValueForShelfAlignment( |
| 1911 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1916 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
| 1912 bounds.x() - coordinate.x()); | 1917 bounds.x() - coordinate.x()); |
| 1913 return distance > 0 ? distance : 0; | 1918 return distance > 0 ? distance : 0; |
| 1914 } | 1919 } |
| 1915 | 1920 |
| 1916 } // namespace ash | 1921 } // namespace ash |
| OLD | NEW |