| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_model.h" | 5 #include "ash/common/shelf/shelf_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/common/shelf/shelf_model_observer.h" |
| 10 #include "ash/shelf/shelf_model_observer.h" | |
| 11 | 10 |
| 12 namespace ash { | 11 namespace ash { |
| 13 | 12 |
| 14 namespace { | 13 namespace { |
| 15 | 14 |
| 16 int ShelfItemTypeToWeight(ShelfItemType type) { | 15 int ShelfItemTypeToWeight(ShelfItemType type) { |
| 17 switch (type) { | 16 switch (type) { |
| 18 case TYPE_APP_LIST: | 17 case TYPE_APP_LIST: |
| 19 // TODO(skuhne): If the app list item becomes movable again, this need | 18 // TODO(skuhne): If the app list item becomes movable again, this need |
| 20 // to be a fallthrough. | 19 // to be a fallthrough. |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 CompareByWeight) - items_.begin(), | 169 CompareByWeight) - items_.begin(), |
| 171 static_cast<ShelfItems::difference_type>(index)); | 170 static_cast<ShelfItems::difference_type>(index)); |
| 172 index = std::min(std::upper_bound(items_.begin(), items_.end(), weight_dummy, | 171 index = std::min(std::upper_bound(items_.begin(), items_.end(), weight_dummy, |
| 173 CompareByWeight) - items_.begin(), | 172 CompareByWeight) - items_.begin(), |
| 174 static_cast<ShelfItems::difference_type>(index)); | 173 static_cast<ShelfItems::difference_type>(index)); |
| 175 | 174 |
| 176 return index; | 175 return index; |
| 177 } | 176 } |
| 178 | 177 |
| 179 } // namespace ash | 178 } // namespace ash |
| OLD | NEW |