Delete the suppressions for issue 79655, which do not show up according to http:...
[chromium-blink-merge.git] / ash / launcher / launcher_item_delegate_manager.cc
blobe401b76bf318df2e8b586630d293a0ecb64c2053
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
3 // found in the LICENSE file.
5 #include "ash/launcher/launcher_item_delegate_manager.h"
7 #include "ash/launcher/launcher_item_delegate.h"
8 #include "ash/launcher/launcher_model.h"
9 #include "ash/shell.h"
10 #include "base/logging.h"
11 #include "base/stl_util.h"
13 namespace ash {
15 LauncherItemDelegateManager::LauncherItemDelegateManager(
16 ash::LauncherModel* model) : model_(model) {
17 DCHECK(model_);
18 model_->AddObserver(this);
21 LauncherItemDelegateManager::~LauncherItemDelegateManager() {
22 model_->RemoveObserver(this);
23 STLDeleteContainerPairSecondPointers(id_to_item_delegate_map_.begin(),
24 id_to_item_delegate_map_.end());
27 void LauncherItemDelegateManager::SetLauncherItemDelegate(
28 ash::LauncherID id,
29 scoped_ptr<LauncherItemDelegate> item_delegate) {
30 // If another LauncherItemDelegate is already registered for |id|, we assume
31 // that this request is replacing LauncherItemDelegate for |id| with
32 // |item_delegate|.
33 RemoveLauncherItemDelegate(id);
34 id_to_item_delegate_map_[id] = item_delegate.release();
37 LauncherItemDelegate* LauncherItemDelegateManager::GetLauncherItemDelegate(
38 ash::LauncherID id) {
39 if (model_->ItemIndexByID(id) != -1) {
40 // Each LauncherItem has to have a LauncherItemDelegate.
41 DCHECK(id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end());
42 return id_to_item_delegate_map_[id];
44 return NULL;
47 void LauncherItemDelegateManager::LauncherItemAdded(int index) {
50 void LauncherItemDelegateManager::LauncherItemRemoved(int index,
51 ash::LauncherID id) {
52 RemoveLauncherItemDelegate(id);
55 void LauncherItemDelegateManager::LauncherItemMoved(int start_index,
56 int target_index) {
59 void LauncherItemDelegateManager::LauncherItemChanged(
60 int index,
61 const LauncherItem& old_item) {
64 void LauncherItemDelegateManager::LauncherStatusChanged() {
67 void LauncherItemDelegateManager::RemoveLauncherItemDelegate(
68 ash::LauncherID id) {
69 if (id_to_item_delegate_map_.find(id) != id_to_item_delegate_map_.end()) {
70 delete id_to_item_delegate_map_[id];
71 id_to_item_delegate_map_.erase(id);
75 } // namespace ash