| 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/common/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/common/shelf/shelf_item_delegate.h" | 9 #include "ash/common/shelf/shelf_item_delegate.h" |
| 10 #include "ash/common/shelf/shelf_model_observer.h" | 10 #include "ash/common/shelf/shelf_model_observer.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return 0; | 21 return 0; |
| 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_APP: | 25 case TYPE_APP: |
| 26 return 2; | 26 return 2; |
| 27 case TYPE_DIALOG: | 27 case TYPE_DIALOG: |
| 28 return 3; | 28 return 3; |
| 29 case TYPE_APP_PANEL: | 29 case TYPE_APP_PANEL: |
| 30 return 4; | 30 return 4; |
| 31 case TYPE_IME_MENU: | |
| 32 return 5; | |
| 33 case TYPE_UNDEFINED: | 31 case TYPE_UNDEFINED: |
| 34 NOTREACHED() << "ShelfItemType must be set"; | 32 NOTREACHED() << "ShelfItemType must be set"; |
| 35 return -1; | 33 return -1; |
| 36 } | 34 } |
| 37 | 35 |
| 38 NOTREACHED() << "Invalid type " << type; | 36 NOTREACHED() << "Invalid type " << type; |
| 39 return 1; | 37 return 1; |
| 40 } | 38 } |
| 41 | 39 |
| 42 bool CompareByWeight(const ShelfItem& a, const ShelfItem& b) { | 40 bool CompareByWeight(const ShelfItem& a, const ShelfItem& b) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 198 |
| 201 return index; | 199 return index; |
| 202 } | 200 } |
| 203 | 201 |
| 204 void ShelfModel::RemoveShelfItemDelegate(ShelfID id) { | 202 void ShelfModel::RemoveShelfItemDelegate(ShelfID id) { |
| 205 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) | 203 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) |
| 206 id_to_item_delegate_map_.erase(id); | 204 id_to_item_delegate_map_.erase(id); |
| 207 } | 205 } |
| 208 | 206 |
| 209 } // namespace ash | 207 } // namespace ash |
| OLD | NEW |