Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index 6e25c52818f40403b7223d70acbd16786fc23dad..34759182fca11a47d04c95c18a0aa73857565b62 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -491,16 +491,12 @@ LauncherDelegate* Shell::GetLauncherDelegate() { |
scoped_ptr<LauncherItemDelegate> controller( |
new internal::AppListShelfItemDelegate); |
- ash::LauncherID app_list_id = 0; |
- // TODO(simon.hong81): Make function for this in shelf_util.h |
// Finding the launcher model's location of the app list and setting its |
// LauncherItemDelegate. |
- for (size_t i = 0; i < launcher_model_->items().size(); ++i) { |
- if (launcher_model_->items()[i].type == ash::TYPE_APP_LIST) { |
- app_list_id = launcher_model_->items()[i].id; |
- break; |
- } |
- } |
+ int app_list_index = |
+ ash::GetLauncherItemIndexForType(ash::TYPE_APP_LIST, *launcher_model_); |
+ DCHECK_GE(app_list_index, 0); |
+ ash::LauncherID app_list_id = launcher_model_->items()[app_list_index].id; |
DCHECK(app_list_id); |
launcher_item_delegate_manager_->SetLauncherItemDelegate( |
app_list_id, |