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 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 Shell::GetInstance()->UpdateShelfVisibility(); | 1893 Shell::GetInstance()->UpdateShelfVisibility(); |
1894 } | 1894 } |
1895 | 1895 |
1896 void ShelfView::OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) { | 1896 void ShelfView::OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) { |
1897 FOR_EACH_OBSERVER(ShelfIconObserver, observers_, | 1897 FOR_EACH_OBSERVER(ShelfIconObserver, observers_, |
1898 OnShelfIconPositionsChanged()); | 1898 OnShelfIconPositionsChanged()); |
1899 PreferredSizeChanged(); | 1899 PreferredSizeChanged(); |
1900 } | 1900 } |
1901 | 1901 |
1902 void ShelfView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { | 1902 void ShelfView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { |
1903 if (snap_back_from_rip_off_view_ && animator == bounds_animator_) { | 1903 if (snap_back_from_rip_off_view_ && animator == bounds_animator_.get()) { |
1904 if (!animator->IsAnimating(snap_back_from_rip_off_view_)) { | 1904 if (!animator->IsAnimating(snap_back_from_rip_off_view_)) { |
1905 // Coming here the animation of the ShelfButton is finished and the | 1905 // Coming here the animation of the ShelfButton is finished and the |
1906 // previously hidden status can be shown again. Since the button itself | 1906 // previously hidden status can be shown again. Since the button itself |
1907 // might have gone away or changed locations we check that the button | 1907 // might have gone away or changed locations we check that the button |
1908 // is still in the shelf and show its status again. | 1908 // is still in the shelf and show its status again. |
1909 for (int index = 0; index < view_model_->view_size(); index++) { | 1909 for (int index = 0; index < view_model_->view_size(); index++) { |
1910 views::View* view = view_model_->view_at(index); | 1910 views::View* view = view_model_->view_at(index); |
1911 if (view == snap_back_from_rip_off_view_) { | 1911 if (view == snap_back_from_rip_off_view_) { |
1912 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); | 1912 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); |
1913 ShelfButton* button = static_cast<ShelfButton*>(view); | 1913 ShelfButton* button = static_cast<ShelfButton*>(view); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1968 distance = bounds.x() - coordinate.x(); | 1968 distance = bounds.x() - coordinate.x(); |
1969 break; | 1969 break; |
1970 case SHELF_ALIGNMENT_TOP: | 1970 case SHELF_ALIGNMENT_TOP: |
1971 distance = coordinate.y() - bounds.bottom(); | 1971 distance = coordinate.y() - bounds.bottom(); |
1972 break; | 1972 break; |
1973 } | 1973 } |
1974 return distance > 0 ? distance : 0; | 1974 return distance > 0 ? distance : 0; |
1975 } | 1975 } |
1976 | 1976 |
1977 } // namespace ash | 1977 } // namespace ash |
OLD | NEW |