Skip to content

Commit

Permalink
Added the shutdown icon to the crostini app list model's builder
Browse files Browse the repository at this point in the history
This was added to the shelf model but not the app list model. On a
related note it may be reasonable to have a common source of truth for
item icons, even if the two models are allowed to have different items.

Bug: 977453
Change-Id: I54c255555e265b8eb841816a7cf11d9b459cb4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761871
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Commit-Queue: Nic Hollingum <hollingum@google.com>
Cr-Commit-Position: refs/heads/master@{#689762}
  • Loading branch information
Nicholas Hollingum authored and Commit Bot committed Aug 23, 2019
1 parent 630cb0b commit 9ffe3a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions chrome/browser/ui/app_list/app_context_menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ AppContextMenu::AppContextMenu(AppContextMenuDelegate* delegate,
: delegate_(delegate),
profile_(profile),
app_id_(app_id),
controller_(controller) {
}
controller_(controller) {}

AppContextMenu::~AppContextMenu() = default;

Expand Down Expand Up @@ -70,7 +69,7 @@ bool AppContextMenu::IsCommandIdEnabled(int command_id) const {

void AppContextMenu::TogglePin(const std::string& shelf_app_id) {
DCHECK_EQ(AppListControllerDelegate::PIN_EDITABLE,
controller_->GetPinnable(shelf_app_id));
controller_->GetPinnable(shelf_app_id));
if (controller_->IsAppPinned(shelf_app_id))
controller_->UnpinApp(shelf_app_id);
else
Expand Down Expand Up @@ -142,6 +141,10 @@ const gfx::VectorIcon& AppContextMenu::GetMenuItemVectorIcon(
NOTREACHED() << "NOTIFICATION_CONTAINER does not have an icon, and it is "
"added to the model by NotificationMenuController.";
return gfx::kNoneIcon;
case ash::STOP_APP:
if (string_id == IDS_CROSTINI_SHUT_DOWN_LINUX_MENU_ITEM)
return views::kLinuxShutdownIcon;
return gfx::kNoneIcon;
default:
NOTREACHED();
return gfx::kNoneIcon;
Expand Down

0 comments on commit 9ffe3a6

Please sign in to comment.