Commit 467e53e9 authored by khmel's avatar khmel Committed by Commit Bot

shelf: Fix crash when activating ARC app using context menu.

This fixes the crash when ARC is activated using Open menu item in shelf
menu in deferred mode by passing safe local instance of ash::ShelfID.

Bug: 776136
Test: Manually.
Change-Id: I11160b1b0073322d6ea8702286b5f8b91af9f822
Reviewed-on: https://chromium-review.googlesource.com/727259
Commit-Queue: Yury Khmel <khmel@google.com>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509955}
parent c6ade254
......@@ -68,8 +68,10 @@ bool LauncherContextMenu::IsCommandIdEnabled(int command_id) const {
void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
switch (static_cast<MenuItem>(command_id)) {
case MENU_OPEN_NEW:
controller_->LaunchApp(item_.id, ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE,
display_id_);
// Use a copy of the id to avoid crashes, as this menu's owner will be
// destroyed if LaunchApp replaces the ShelfItemDelegate instance.
controller_->LaunchApp(ash::ShelfID(item_.id), ash::LAUNCH_FROM_UNKNOWN,
ui::EF_NONE, display_id_);
break;
case MENU_CLOSE:
if (item_.type == ash::TYPE_DIALOG) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment