Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index 5ad43a285926f729dc7fe47a9eddbf69af56ee09..6fdf5e13644b88b9646aaf4798588dbb63d7b184 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -496,16 +496,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, |