| 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 "base/logging.h" | |
| 8 | |
| 9 namespace ash { | 7 namespace ash { |
| 10 | 8 |
| 11 LauncherItemDelegateManager::LauncherItemDelegateManager() { | 9 LauncherItemDelegateManager::LauncherItemDelegateManager() { |
| 12 } | 10 } |
| 13 | 11 |
| 14 LauncherItemDelegateManager::~LauncherItemDelegateManager() { | 12 LauncherItemDelegateManager::~LauncherItemDelegateManager() { |
| 15 } | 13 } |
| 16 | 14 |
| 17 void LauncherItemDelegateManager::RegisterLauncherItemDelegate( | 15 void LauncherItemDelegateManager::RegisterLauncherItemDelegate( |
| 18 ash::LauncherItemType type, LauncherItemDelegate* item_delegate) { | 16 ash::LauncherItemType type, LauncherItemDelegate* item_delegate) { |
| 19 // When a new |item_delegate| is registered with an exsiting |type|, it will | 17 // When a new |item_delegate| is registered with an exsiting |type|, it will |
| 20 // get overwritten. | 18 // get overwritten. |
| 21 item_type_to_item_delegate_map_[type] = item_delegate; | 19 item_type_to_item_delegate_map_[type] = item_delegate; |
| 22 } | 20 } |
| 23 | 21 |
| 24 LauncherItemDelegate* LauncherItemDelegateManager::GetLauncherItemDelegate( | 22 LauncherItemDelegate* LauncherItemDelegateManager::GetLauncherItemDelegate( |
| 25 ash::LauncherItemType item_type) { | 23 ash::LauncherItemType item_type) { |
| 26 DCHECK(item_type_to_item_delegate_map_.find(item_type) != | 24 DCHECK(item_type_to_item_delegate_map_.find(item_type) != |
| 27 item_type_to_item_delegate_map_.end()); | 25 item_type_to_item_delegate_map_.end()); |
| 28 return item_type_to_item_delegate_map_[item_type]; | 26 return item_type_to_item_delegate_map_[item_type]; |
| 29 } | 27 } |
| 30 | 28 |
| 31 } // namespace ash | 29 } // namespace ash |
| OLD | NEW |