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_item_delegate_manager.h" | 5 #include "ash/shelf/shelf_item_delegate_manager.h" |
6 | 6 |
7 #include "ash/shelf/shelf_item_delegate.h" | 7 #include "ash/shelf/shelf_item_delegate.h" |
8 #include "ash/shelf/shelf_model.h" | 8 #include "ash/shelf/shelf_model.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 ShelfItemDelegate* ShelfItemDelegateManager::GetShelfItemDelegate(ShelfID id) { | 52 ShelfItemDelegate* ShelfItemDelegateManager::GetShelfItemDelegate(ShelfID id) { |
53 if (model_->ItemIndexByID(id) != -1) { | 53 if (model_->ItemIndexByID(id) != -1) { |
54 // Each ShelfItem has to have a ShelfItemDelegate. | 54 // Each ShelfItem has to have a ShelfItemDelegate. |
55 DCHECK(id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()); | 55 DCHECK(id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()); |
56 return id_to_item_delegate_map_[id]; | 56 return id_to_item_delegate_map_[id]; |
57 } | 57 } |
58 return NULL; | 58 return NULL; |
59 } | 59 } |
60 | 60 |
61 void ShelfItemDelegateManager::ShelfItemAdded(int index) { | 61 void ShelfItemDelegateManager::ShelfItemAdded(int index) {} |
62 } | |
63 | 62 |
64 void ShelfItemDelegateManager::ShelfItemRemoved(int index, ShelfID id) { | 63 void ShelfItemDelegateManager::ShelfItemRemoved(int index, ShelfID id) { |
65 RemoveShelfItemDelegate(id); | 64 RemoveShelfItemDelegate(id); |
66 FOR_EACH_OBSERVER(ShelfItemDelegateManagerObserver, | 65 FOR_EACH_OBSERVER(ShelfItemDelegateManagerObserver, |
67 observers_, | 66 observers_, |
68 OnSetShelfItemDelegate(id, nullptr)); | 67 OnSetShelfItemDelegate(id, nullptr)); |
69 } | 68 } |
70 | 69 |
71 void ShelfItemDelegateManager::ShelfItemMoved(int start_index, | 70 void ShelfItemDelegateManager::ShelfItemMoved(int start_index, |
72 int target_index) { | 71 int target_index) {} |
73 } | |
74 | 72 |
75 void ShelfItemDelegateManager::ShelfItemChanged(int index, | 73 void ShelfItemDelegateManager::ShelfItemChanged(int index, |
76 const ShelfItem& old_item) { | 74 const ShelfItem& old_item) {} |
77 } | |
78 | |
79 void ShelfItemDelegateManager::ShelfStatusChanged() { | |
80 } | |
81 | 75 |
82 void ShelfItemDelegateManager::RemoveShelfItemDelegate(ShelfID id) { | 76 void ShelfItemDelegateManager::RemoveShelfItemDelegate(ShelfID id) { |
83 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) { | 77 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) { |
84 delete id_to_item_delegate_map_[id]; | 78 delete id_to_item_delegate_map_[id]; |
85 id_to_item_delegate_map_.erase(id); | 79 id_to_item_delegate_map_.erase(id); |
86 } | 80 } |
87 } | 81 } |
88 | 82 |
89 } // namespace ash | 83 } // namespace ash |
OLD | NEW |