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 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 // change as well. | 1669 // change as well. |
1670 case TYPE_APP_SHORTCUT: | 1670 case TYPE_APP_SHORTCUT: |
1671 case TYPE_WINDOWED_APP: | 1671 case TYPE_WINDOWED_APP: |
1672 case TYPE_PLATFORM_APP: | 1672 case TYPE_PLATFORM_APP: |
1673 case TYPE_DIALOG: | 1673 case TYPE_DIALOG: |
1674 case TYPE_APP_PANEL: | 1674 case TYPE_APP_PANEL: |
1675 case TYPE_IME_MENU: { | 1675 case TYPE_IME_MENU: { |
1676 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); | 1676 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); |
1677 ShelfButton* button = static_cast<ShelfButton*>(view); | 1677 ShelfButton* button = static_cast<ShelfButton*>(view); |
1678 ReflectItemStatus(item, button); | 1678 ReflectItemStatus(item, button); |
1679 // The browser shortcut is currently not a "real" item and as such the | 1679 button->SetImage(item.image); |
1680 // the image is bogous as well. We therefore keep the image as is for it. | |
1681 if (item.type != TYPE_BROWSER_SHORTCUT) | |
1682 button->SetImage(item.image); | |
1683 button->SchedulePaint(); | 1680 button->SchedulePaint(); |
1684 break; | 1681 break; |
1685 } | 1682 } |
1686 | 1683 |
1687 default: | 1684 default: |
1688 break; | 1685 break; |
1689 } | 1686 } |
1690 } | 1687 } |
1691 | 1688 |
1692 void ShelfView::ShelfItemMoved(int start_index, int target_index) { | 1689 void ShelfView::ShelfItemMoved(int start_index, int target_index) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 | 1916 |
1920 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1917 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
1921 const gfx::Rect bounds = GetBoundsInScreen(); | 1918 const gfx::Rect bounds = GetBoundsInScreen(); |
1922 int distance = shelf_->SelectValueForShelfAlignment( | 1919 int distance = shelf_->SelectValueForShelfAlignment( |
1923 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1920 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
1924 bounds.x() - coordinate.x()); | 1921 bounds.x() - coordinate.x()); |
1925 return distance > 0 ? distance : 0; | 1922 return distance > 0 ? distance : 0; |
1926 } | 1923 } |
1927 | 1924 |
1928 } // namespace ash | 1925 } // namespace ash |
OLD | NEW |