Index: ash/shelf/app_list_shelf_item_delegate.cc |
diff --git a/ash/shelf/app_list_shelf_item_delegate.cc b/ash/shelf/app_list_shelf_item_delegate.cc |
index 6e804969eb67098aeedbb5ab63e68107cc85045f..691628f1ea9aceadf624e628c5a0b144fcdef261 100644 |
--- a/ash/shelf/app_list_shelf_item_delegate.cc |
+++ b/ash/shelf/app_list_shelf_item_delegate.cc |
@@ -13,23 +13,30 @@ |
namespace ash { |
+namespace { |
+ |
+// An app id for the app list, used to identify the shelf item. |
+static constexpr const char kAppListAppID[] = "AppList"; |
James Cook
2017/05/04 16:38:49
"static constexpr const"? Maybe just const or just
msw
2017/05/04 19:05:57
Done, I changed the identifier (but left the 'k' p
|
+ |
+} // namespace |
+ |
// static |
void AppListShelfItemDelegate::CreateAppListItemAndDelegate(ShelfModel* model) { |
// Add the app list item to the shelf model. |
ShelfItem item; |
item.type = TYPE_APP_LIST; |
+ item.id = ShelfID(kAppListAppID); |
item.title = l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); |
int index = model->Add(item); |
DCHECK_GE(index, 0); |
// Create an AppListShelfItemDelegate for that item. |
- ShelfID id = model->items()[index].id; |
- DCHECK_NE(id, kInvalidShelfID); |
- model->SetShelfItemDelegate(id, base::MakeUnique<AppListShelfItemDelegate>()); |
+ model->SetShelfItemDelegate(item.id, |
+ base::MakeUnique<AppListShelfItemDelegate>()); |
} |
AppListShelfItemDelegate::AppListShelfItemDelegate() |
- : ShelfItemDelegate(AppLaunchId()) {} |
+ : ShelfItemDelegate(ShelfID(kAppListAppID)) {} |
AppListShelfItemDelegate::~AppListShelfItemDelegate() {} |