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/common/shelf/shelf_view.h" | 5 #include "ash/common/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 AnimateToIdealBounds(); | 747 AnimateToIdealBounds(); |
748 return; | 748 return; |
749 } | 749 } |
750 | 750 |
751 IdealBounds ideal_bounds; | 751 IdealBounds ideal_bounds; |
752 CalculateIdealBounds(&ideal_bounds); | 752 CalculateIdealBounds(&ideal_bounds); |
753 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); | 753 views::ViewModelUtils::SetViewBoundsToIdealBounds(*view_model_); |
754 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds); | 754 overflow_button_->SetBoundsRect(ideal_bounds.overflow_bounds); |
755 } | 755 } |
756 | 756 |
757 void ShelfView::UpdateShelfItemBackground(int alpha) { | 757 void ShelfView::UpdateShelfItemBackground(SkColor color) { |
758 GetAppListButton()->SetBackgroundAlpha(alpha); | 758 GetAppListButton()->UpdateShelfItemBackground(color); |
759 overflow_button_->SetBackgroundAlpha(alpha); | 759 overflow_button_->UpdateShelfItemBackground(color); |
760 } | 760 } |
761 | 761 |
762 void ShelfView::UpdateAllButtonsVisibilityInOverflowMode() { | 762 void ShelfView::UpdateAllButtonsVisibilityInOverflowMode() { |
763 // The overflow button is not shown in overflow mode. | 763 // The overflow button is not shown in overflow mode. |
764 overflow_button_->SetVisible(false); | 764 overflow_button_->SetVisible(false); |
765 DCHECK_LT(last_visible_index_, view_model_->view_size()); | 765 DCHECK_LT(last_visible_index_, view_model_->view_size()); |
766 for (int i = 0; i < view_model_->view_size(); ++i) { | 766 for (int i = 0; i < view_model_->view_size(); ++i) { |
767 bool visible = i >= first_visible_index_ && i <= last_visible_index_; | 767 bool visible = i >= first_visible_index_ && i <= last_visible_index_; |
768 // To track the dragging of |drag_view_| continuously, its visibility | 768 // To track the dragging of |drag_view_| continuously, its visibility |
769 // should be always true regardless of its position. | 769 // should be always true regardless of its position. |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 | 1776 |
1777 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1777 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
1778 const gfx::Rect bounds = GetBoundsInScreen(); | 1778 const gfx::Rect bounds = GetBoundsInScreen(); |
1779 int distance = wm_shelf_->SelectValueForShelfAlignment( | 1779 int distance = wm_shelf_->SelectValueForShelfAlignment( |
1780 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1780 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
1781 bounds.x() - coordinate.x()); | 1781 bounds.x() - coordinate.x()); |
1782 return distance > 0 ? distance : 0; | 1782 return distance > 0 ? distance : 0; |
1783 } | 1783 } |
1784 | 1784 |
1785 } // namespace ash | 1785 } // namespace ash |
OLD | NEW |