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

Unified Diff: ash/common/shelf/shelf_controller.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.cc ('k') | ash/common/shelf/shelf_item_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_controller.cc
diff --git a/ash/common/shelf/shelf_controller.cc b/ash/common/shelf/shelf_controller.cc
index 78b0874c10fcac3201e2325613338325d6b9b31b..2cea707e4a100546a6db8f42c6589c36cd14e85d 100644
--- a/ash/common/shelf/shelf_controller.cc
+++ b/ash/common/shelf/shelf_controller.cc
@@ -60,7 +60,7 @@ class ShelfItemDelegateMus : public ShelfItemDelegate {
explicit ShelfMenuModelMus(ShelfItemDelegateMus* item_delegate)
: ShelfMenuModel(this), item_delegate_(item_delegate) {
AddSeparator(ui::SPACING_SEPARATOR);
- AddItem(0, item_delegate_->GetTitle());
+ AddItem(0, item_delegate_->title());
AddSeparator(ui::SPACING_SEPARATOR);
for (const auto& window : item_delegate_->window_id_to_title())
AddItem(window.first, window.second);
@@ -100,11 +100,6 @@ class ShelfItemDelegateMus : public ShelfItemDelegate {
return kNoAction;
}
- base::string16 GetTitle() override {
- return window_id_to_title_.empty() ? title_
- : window_id_to_title_.begin()->second;
- }
-
ShelfMenuModel* CreateApplicationMenu(int event_flags) override {
return new ShelfMenuModelMus(this);
}
@@ -232,13 +227,14 @@ void ShelfController::PinItem(
shelf_item.type = TYPE_APP_SHORTCUT;
shelf_item.status = STATUS_CLOSED;
shelf_item.image = GetShelfIconFromBitmap(item->image);
+ shelf_item.title = base::UTF8ToUTF16(item->app_title);
model_.Add(shelf_item);
- std::unique_ptr<ShelfItemDelegateMus> item_delegate(
- new ShelfItemDelegateMus());
+ std::unique_ptr<ShelfItemDelegateMus> item_delegate =
+ base::MakeUnique<ShelfItemDelegateMus>();
item_delegate->SetDelegate(std::move(delegate));
item_delegate->set_pinned(true);
- item_delegate->set_title(base::UTF8ToUTF16(item->app_title));
+ item_delegate->set_title(shelf_item.title);
model_.SetShelfItemDelegate(shelf_id, std::move(item_delegate));
}
« no previous file with comments | « ash/common/shelf/app_list_shelf_item_delegate.cc ('k') | ash/common/shelf/shelf_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698