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

Unified Diff: ash/shelf/app_list_shelf_item_delegate.cc

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. Created 3 years, 7 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
« no previous file with comments | « ash/public/interfaces/shelf.mojom ('k') | ash/shelf/shelf_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..559c2dd6431442bfc0133fc386d2a9ee0fb543fb 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 char kAppListId[] = "AppListId";
+
+} // 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(kAppListId);
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(kAppListId)) {}
AppListShelfItemDelegate::~AppListShelfItemDelegate() {}
« no previous file with comments | « ash/public/interfaces/shelf.mojom ('k') | ash/shelf/shelf_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698