| 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/launcher/launcher_view.h" | 5 #include "ash/launcher/launcher_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 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 model_->Move(current_index, start_drag_index_); | 1169 model_->Move(current_index, start_drag_index_); |
| 1170 AnimateToIdealBounds(); | 1170 AnimateToIdealBounds(); |
| 1171 } | 1171 } |
| 1172 drag_view_->layer()->SetOpacity(1.0f); | 1172 drag_view_->layer()->SetOpacity(1.0f); |
| 1173 } | 1173 } |
| 1174 DestroyDragIconProxy(); | 1174 DestroyDragIconProxy(); |
| 1175 } | 1175 } |
| 1176 | 1176 |
| 1177 LauncherView::RemovableState LauncherView::RemovableByRipOff(int index) { | 1177 LauncherView::RemovableState LauncherView::RemovableByRipOff(int index) { |
| 1178 LauncherItemType type = model_->items()[index].type; | 1178 LauncherItemType type = model_->items()[index].type; |
| 1179 if (type == TYPE_APP_LIST) | 1179 if (type == TYPE_APP_LIST || !delegate_->CanPin()) |
| 1180 return NOT_REMOVABLE; | 1180 return NOT_REMOVABLE; |
| 1181 std::string app_id = | 1181 std::string app_id = |
| 1182 delegate_->GetAppIDForLauncherID(model_->items()[index].id); | 1182 delegate_->GetAppIDForLauncherID(model_->items()[index].id); |
| 1183 // Note: Only pinned app shortcuts can be removed! | 1183 // Note: Only pinned app shortcuts can be removed! |
| 1184 return (type == TYPE_APP_SHORTCUT && delegate_->IsAppPinned(app_id)) ? | 1184 return (type == TYPE_APP_SHORTCUT && delegate_->IsAppPinned(app_id)) ? |
| 1185 REMOVABLE : DRAGGABLE; | 1185 REMOVABLE : DRAGGABLE; |
| 1186 } | 1186 } |
| 1187 | 1187 |
| 1188 bool LauncherView::SameDragType(LauncherItemType typea, | 1188 bool LauncherView::SameDragType(LauncherItemType typea, |
| 1189 LauncherItemType typeb) const { | 1189 LauncherItemType typeb) const { |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 break; | 1881 break; |
| 1882 case ash::SHELF_ALIGNMENT_TOP: | 1882 case ash::SHELF_ALIGNMENT_TOP: |
| 1883 distance = coordinate.y() - bounds.bottom(); | 1883 distance = coordinate.y() - bounds.bottom(); |
| 1884 break; | 1884 break; |
| 1885 } | 1885 } |
| 1886 return distance > 0 ? distance : 0; | 1886 return distance > 0 ? distance : 0; |
| 1887 } | 1887 } |
| 1888 | 1888 |
| 1889 } // namespace internal | 1889 } // namespace internal |
| 1890 } // namespace ash | 1890 } // namespace ash |
| OLD | NEW |