| 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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 // change as well. | 1644 // change as well. |
| 1645 case TYPE_APP_SHORTCUT: | 1645 case TYPE_APP_SHORTCUT: |
| 1646 case TYPE_WINDOWED_APP: | 1646 case TYPE_WINDOWED_APP: |
| 1647 case TYPE_PLATFORM_APP: | 1647 case TYPE_PLATFORM_APP: |
| 1648 case TYPE_DIALOG: | 1648 case TYPE_DIALOG: |
| 1649 case TYPE_APP_PANEL: | 1649 case TYPE_APP_PANEL: |
| 1650 case TYPE_IME_MENU: { | 1650 case TYPE_IME_MENU: { |
| 1651 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); | 1651 CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); |
| 1652 ShelfButton* button = static_cast<ShelfButton*>(view); | 1652 ShelfButton* button = static_cast<ShelfButton*>(view); |
| 1653 ReflectItemStatus(item, button); | 1653 ReflectItemStatus(item, button); |
| 1654 // The browser shortcut is currently not a "real" item and as such the | 1654 button->SetImage(item.image); |
| 1655 // the image is bogous as well. We therefore keep the image as is for it. | |
| 1656 if (item.type != TYPE_BROWSER_SHORTCUT) | |
| 1657 button->SetImage(item.image); | |
| 1658 button->SchedulePaint(); | 1655 button->SchedulePaint(); |
| 1659 break; | 1656 break; |
| 1660 } | 1657 } |
| 1661 | 1658 |
| 1662 default: | 1659 default: |
| 1663 break; | 1660 break; |
| 1664 } | 1661 } |
| 1665 } | 1662 } |
| 1666 | 1663 |
| 1667 void ShelfView::ShelfItemMoved(int start_index, int target_index) { | 1664 void ShelfView::ShelfItemMoved(int start_index, int target_index) { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1898 | 1895 |
| 1899 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { | 1896 int ShelfView::CalculateShelfDistance(const gfx::Point& coordinate) const { |
| 1900 const gfx::Rect bounds = GetBoundsInScreen(); | 1897 const gfx::Rect bounds = GetBoundsInScreen(); |
| 1901 int distance = shelf_->SelectValueForShelfAlignment( | 1898 int distance = shelf_->SelectValueForShelfAlignment( |
| 1902 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), | 1899 bounds.y() - coordinate.y(), coordinate.x() - bounds.right(), |
| 1903 bounds.x() - coordinate.x()); | 1900 bounds.x() - coordinate.x()); |
| 1904 return distance > 0 ? distance : 0; | 1901 return distance > 0 ? distance : 0; |
| 1905 } | 1902 } |
| 1906 | 1903 |
| 1907 } // namespace ash | 1904 } // namespace ash |
| OLD | NEW |