Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2668)

Unified Diff: ash/shell.cc

Issue 27369004: Change GetBrowserItemIndex() to GetLauncherItemIndexForType() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698