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

Unified Diff: ash/common/shelf/app_list_shelf_item_delegate.cc

Issue 2627533002: Replace ShelfItemDelegate::GetTitle() with ShelfItem::title. (Closed)
Patch Set: Address comments. Created 3 years, 11 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/common/shelf/app_list_shelf_item_delegate.h ('k') | ash/common/shelf/shelf_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/app_list_shelf_item_delegate.cc
diff --git a/ash/common/shelf/app_list_shelf_item_delegate.cc b/ash/common/shelf/app_list_shelf_item_delegate.cc
index 53143bed055d57b38ef3b3825fec4249ce72509c..af2dbb30763311d3f4b67767232a3d369dfc98f1 100644
--- a/ash/common/shelf/app_list_shelf_item_delegate.cc
+++ b/ash/common/shelf/app_list_shelf_item_delegate.cc
@@ -14,19 +14,18 @@
namespace ash {
// static
-void AppListShelfItemDelegate::CreateAppListItemAndDelegate(
- ShelfModel* shelf_model) {
+void AppListShelfItemDelegate::CreateAppListItemAndDelegate(ShelfModel* model) {
// Add the app list item to the shelf model.
- ShelfItem app_list;
- app_list.type = TYPE_APP_LIST;
- int app_list_index = shelf_model->Add(app_list);
- DCHECK_GE(app_list_index, 0);
+ ShelfItem item;
+ item.type = TYPE_APP_LIST;
+ 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 app_list_id = shelf_model->items()[app_list_index].id;
- DCHECK_GE(app_list_id, 0);
- shelf_model->SetShelfItemDelegate(
- app_list_id, base::MakeUnique<AppListShelfItemDelegate>());
+ ShelfID id = model->items()[index].id;
+ DCHECK_GE(id, 0);
+ model->SetShelfItemDelegate(id, base::MakeUnique<AppListShelfItemDelegate>());
}
AppListShelfItemDelegate::AppListShelfItemDelegate() {}
@@ -39,16 +38,6 @@ ShelfItemDelegate::PerformedAction AppListShelfItemDelegate::ItemSelected(
return ShelfItemDelegate::kAppListMenuShown;
}
-base::string16 AppListShelfItemDelegate::GetTitle() {
- ShelfModel* model = WmShell::Get()->shelf_model();
- DCHECK(model);
- int title_id;
- title_id = model->status() == ShelfModel::STATUS_LOADING
- ? IDS_ASH_SHELF_APP_LIST_LAUNCHER_SYNCING_TITLE
- : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE;
- return l10n_util::GetStringUTF16(title_id);
-}
-
ShelfMenuModel* AppListShelfItemDelegate::CreateApplicationMenu(
int event_flags) {
// AppList does not show an application menu.
« no previous file with comments | « ash/common/shelf/app_list_shelf_item_delegate.h ('k') | ash/common/shelf/shelf_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698