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

Unified Diff: ash/shelf/shelf_controller.cc

Issue 2917013002: mash: Move ShelfModel* to ash/public/cpp. (Closed)
Patch Set: Comment on AppList item init. 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/shelf/shelf_controller.h ('k') | ash/shelf/shelf_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_controller.cc
diff --git a/ash/shelf/shelf_controller.cc b/ash/shelf/shelf_controller.cc
index 4b51989ebf6f3d4ddf87e98c4142e67d966df75d..16dcbb5084fbc48736a6b56a4747f9aaa37ec608 100644
--- a/ash/shelf/shelf_controller.cc
+++ b/ash/shelf/shelf_controller.cc
@@ -11,8 +11,10 @@
#include "ash/shelf/app_list_shelf_item_delegate.h"
#include "ash/shelf/shelf.h"
#include "ash/shell.h"
+#include "ash/strings/grit/ash_strings.h"
#include "base/auto_reset.h"
#include "base/strings/utf_string_conversions.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
@@ -32,9 +34,14 @@ Shelf* GetShelfForDisplay(int64_t display_id) {
} // namespace
ShelfController::ShelfController() {
- // Create an AppListShelfItemDelegate for the app list item.
+ // Set the delegate and title string for the app list item.
model_.SetShelfItemDelegate(ShelfID(kAppListId),
base::MakeUnique<AppListShelfItemDelegate>());
+ DCHECK_EQ(0, model_.ItemIndexByID(ShelfID(kAppListId)));
+ ShelfItem item = model_.items()[0];
+ item.title = l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE);
+ model_.Set(0, item);
+
model_.AddObserver(this);
}
« no previous file with comments | « ash/shelf/shelf_controller.h ('k') | ash/shelf/shelf_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698