| 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/shelf/shelf_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/shelf/shelf_model_observer.h" | 10 #include "ash/shelf/shelf_model_observer.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 case TYPE_BROWSER_SHORTCUT: | 22 case TYPE_BROWSER_SHORTCUT: |
| 23 case TYPE_APP_SHORTCUT: | 23 case TYPE_APP_SHORTCUT: |
| 24 return 1; | 24 return 1; |
| 25 case TYPE_WINDOWED_APP: | 25 case TYPE_WINDOWED_APP: |
| 26 case TYPE_PLATFORM_APP: | 26 case TYPE_PLATFORM_APP: |
| 27 return 2; | 27 return 2; |
| 28 case TYPE_DIALOG: | 28 case TYPE_DIALOG: |
| 29 return 3; | 29 return 3; |
| 30 case TYPE_APP_PANEL: | 30 case TYPE_APP_PANEL: |
| 31 return 4; | 31 return 4; |
| 32 case TYPE_IME_MENU: |
| 33 return 5; |
| 32 case TYPE_UNDEFINED: | 34 case TYPE_UNDEFINED: |
| 33 NOTREACHED() << "ShelfItemType must be set"; | 35 NOTREACHED() << "ShelfItemType must be set"; |
| 34 return -1; | 36 return -1; |
| 35 } | 37 } |
| 36 | 38 |
| 37 NOTREACHED() << "Invalid type " << type; | 39 NOTREACHED() << "Invalid type " << type; |
| 38 return 1; | 40 return 1; |
| 39 } | 41 } |
| 40 | 42 |
| 41 bool CompareByWeight(const ShelfItem& a, const ShelfItem& b) { | 43 bool CompareByWeight(const ShelfItem& a, const ShelfItem& b) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 CompareByWeight) - items_.begin(), | 170 CompareByWeight) - items_.begin(), |
| 169 static_cast<ShelfItems::difference_type>(index)); | 171 static_cast<ShelfItems::difference_type>(index)); |
| 170 index = std::min(std::upper_bound(items_.begin(), items_.end(), weight_dummy, | 172 index = std::min(std::upper_bound(items_.begin(), items_.end(), weight_dummy, |
| 171 CompareByWeight) - items_.begin(), | 173 CompareByWeight) - items_.begin(), |
| 172 static_cast<ShelfItems::difference_type>(index)); | 174 static_cast<ShelfItems::difference_type>(index)); |
| 173 | 175 |
| 174 return index; | 176 return index; |
| 175 } | 177 } |
| 176 | 178 |
| 177 } // namespace ash | 179 } // namespace ash |
| OLD | NEW |