Commit 7fdffd4f authored by James Cook's avatar James Cook Committed by Commit Bot

apps: Clean up AppServiceShelfContextMenu::ShouldAddPinMenu

Type kBorealis had a FALLTHROUGH to the default case, which contains
a NOTREACHED().

Remove FALLTHROUGH, since those are only needed for non-empty blocks.

Remove default case, so the compiler will emit an error when an
app type is not included. This reveals that AppType::kRemote was not
being handled.

No behavior changed expected. I just noticed this while working on
an unrelated issue.

Bug: none
Change-Id: If55a1473c5739f5070b1377aae7e06da704a1806
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2393949Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805969}
parent 158e82a8
......@@ -517,7 +517,6 @@ bool AppServiceShelfContextMenu::ShouldAddPinMenu() {
return false;
}
case apps::mojom::AppType::kPluginVm:
FALLTHROUGH;
case apps::mojom::AppType::kBuiltIn: {
bool show_in_launcher = false;
apps::AppServiceProxy* proxy =
......@@ -530,21 +529,18 @@ bool AppServiceShelfContextMenu::ShouldAddPinMenu() {
return show_in_launcher;
}
case apps::mojom::AppType::kCrostini:
FALLTHROUGH;
case apps::mojom::AppType::kExtension:
FALLTHROUGH;
case apps::mojom::AppType::kLacros:
FALLTHROUGH;
case apps::mojom::AppType::kWeb:
return true;
case apps::mojom::AppType::kUnknown:
FALLTHROUGH;
case apps::mojom::AppType::kMacNative:
// Type kUnknown is used for "unregistered" Crostini apps, which do not
// have a .desktop file and can only be closed, not pinned.
return false;
case apps::mojom::AppType::kMacNative:
case apps::mojom::AppType::kRemote:
case apps::mojom::AppType::kBorealis:
FALLTHROUGH;
default:
NOTREACHED() << "All AppType must decide if pin menu should be added.";
NOTREACHED() << "Type " << app_type_ << " should not appear in shelf.";
return false;
}
}
......
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