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