| 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 #ifndef ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_ | 5 #ifndef ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_ |
| 6 #define ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_ | 6 #define ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 scoped_ptr<ShelfItemDelegate> item_delegate); | 54 scoped_ptr<ShelfItemDelegate> item_delegate); |
| 55 | 55 |
| 56 // Returns ShelfItemDelegate for |item_type|. Always returns non-NULL. | 56 // Returns ShelfItemDelegate for |item_type|. Always returns non-NULL. |
| 57 ShelfItemDelegate* GetShelfItemDelegate(ShelfID id); | 57 ShelfItemDelegate* GetShelfItemDelegate(ShelfID id); |
| 58 | 58 |
| 59 // ShelfModelObserver overrides: | 59 // ShelfModelObserver overrides: |
| 60 void ShelfItemAdded(int model_index) override; | 60 void ShelfItemAdded(int model_index) override; |
| 61 void ShelfItemRemoved(int index, ShelfID id) override; | 61 void ShelfItemRemoved(int index, ShelfID id) override; |
| 62 void ShelfItemMoved(int start_index, int targetindex) override; | 62 void ShelfItemMoved(int start_index, int targetindex) override; |
| 63 void ShelfItemChanged(int index, const ShelfItem& old_item) override; | 63 void ShelfItemChanged(int index, const ShelfItem& old_item) override; |
| 64 void ShelfStatusChanged() override; | |
| 65 | 64 |
| 66 private: | 65 private: |
| 67 friend class test::ShelfItemDelegateManagerTestAPI; | 66 friend class test::ShelfItemDelegateManagerTestAPI; |
| 68 | 67 |
| 69 typedef std::map<ShelfID, ShelfItemDelegate*> ShelfIDToItemDelegateMap; | 68 typedef std::map<ShelfID, ShelfItemDelegate*> ShelfIDToItemDelegateMap; |
| 70 | 69 |
| 71 // Remove and destroy ShelfItemDelegate for |id|. | 70 // Remove and destroy ShelfItemDelegate for |id|. |
| 72 void RemoveShelfItemDelegate(ShelfID id); | 71 void RemoveShelfItemDelegate(ShelfID id); |
| 73 | 72 |
| 74 // Owned by Shell. | 73 // Owned by Shell. |
| 75 ShelfModel* model_; | 74 ShelfModel* model_; |
| 76 | 75 |
| 77 ShelfIDToItemDelegateMap id_to_item_delegate_map_; | 76 ShelfIDToItemDelegateMap id_to_item_delegate_map_; |
| 78 | 77 |
| 79 base::ObserverList<ShelfItemDelegateManagerObserver> observers_; | 78 base::ObserverList<ShelfItemDelegateManagerObserver> observers_; |
| 80 | 79 |
| 81 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateManager); | 80 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateManager); |
| 82 }; | 81 }; |
| 83 | 82 |
| 84 } // namespace ash | 83 } // namespace ash |
| 85 | 84 |
| 86 #endif // ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_ | 85 #endif // ASH_SHELF_SHELF_ITEM_DELEGATE_MANAGER_H_ |
| OLD | NEW |