| Index: ash/shell.cc
|
| diff --git a/ash/shell.cc b/ash/shell.cc
|
| index 6e25c52818f40403b7223d70acbd16786fc23dad..b87a9467f5272313bea319e337026640b6d364ae 100644
|
| --- a/ash/shell.cc
|
| +++ b/ash/shell.cc
|
| @@ -33,6 +33,7 @@
|
| #include "ash/launcher/launcher_item_delegate.h"
|
| #include "ash/launcher/launcher_item_delegate_manager.h"
|
| #include "ash/launcher/launcher_model.h"
|
| +#include "ash/launcher/launcher_model_util.h"
|
| #include "ash/magnifier/magnification_controller.h"
|
| #include "ash/magnifier/partial_magnification_controller.h"
|
| #include "ash/root_window_controller.h"
|
| @@ -40,7 +41,6 @@
|
| #include "ash/session_state_delegate.h"
|
| #include "ash/shelf/app_list_shelf_item_delegate.h"
|
| #include "ash/shelf/shelf_layout_manager.h"
|
| -#include "ash/shelf/shelf_util.h"
|
| #include "ash/shelf/shelf_widget.h"
|
| #include "ash/shell_delegate.h"
|
| #include "ash/shell_factory.h"
|
| @@ -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,
|
|
|