| 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/launcher/launcher_item_delegate_manager.h" | 5 #include "ash/launcher/launcher_item_delegate_manager.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher_item_delegate.h" | 7 #include "ash/launcher/launcher_item_delegate.h" |
| 8 #include "ash/launcher/launcher_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" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | 14 |
| 15 LauncherItemDelegateManager::LauncherItemDelegateManager( | 15 LauncherItemDelegateManager::LauncherItemDelegateManager(ShelfModel* model) |
| 16 ash::LauncherModel* model) : model_(model) { | 16 : model_(model) { |
| 17 DCHECK(model_); | 17 DCHECK(model_); |
| 18 model_->AddObserver(this); | 18 model_->AddObserver(this); |
| 19 } | 19 } |
| 20 | 20 |
| 21 LauncherItemDelegateManager::~LauncherItemDelegateManager() { | 21 LauncherItemDelegateManager::~LauncherItemDelegateManager() { |
| 22 model_->RemoveObserver(this); | 22 model_->RemoveObserver(this); |
| 23 STLDeleteContainerPairSecondPointers(id_to_item_delegate_map_.begin(), | 23 STLDeleteContainerPairSecondPointers(id_to_item_delegate_map_.begin(), |
| 24 id_to_item_delegate_map_.end()); | 24 id_to_item_delegate_map_.end()); |
| 25 } | 25 } |
| 26 | 26 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 void LauncherItemDelegateManager::RemoveLauncherItemDelegate( | 66 void LauncherItemDelegateManager::RemoveLauncherItemDelegate( |
| 67 ash::LauncherID id) { | 67 ash::LauncherID id) { |
| 68 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) { | 68 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) { |
| 69 delete id_to_item_delegate_map_[id]; | 69 delete id_to_item_delegate_map_[id]; |
| 70 id_to_item_delegate_map_.erase(id); | 70 id_to_item_delegate_map_.erase(id); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace ash | 74 } // namespace ash |
| OLD | NEW |